Class TopicDataType
Defined in File TopicDataType.hpp
Inheritance Relationships
Derived Types
public eprosima::fastdds::dds::builtin::TypeLookup_ReplyPubSubType
(Class TypeLookup_ReplyPubSubType)public eprosima::fastdds::dds::builtin::TypeLookup_RequestPubSubType
(Class TypeLookup_RequestPubSubType)public eprosima::fastrtps::types::DynamicPubSubType
(Class DynamicPubSubType)
Class Documentation
-
class TopicDataType
Class TopicDataType used to provide the DomainRTPSParticipant with the methods to serialize, deserialize and get the key of a specific data type. The user should created a class that inherits from this one, where Serialize and deserialize methods MUST be implemented. ,
Subclassed by eprosima::fastdds::dds::builtin::TypeLookup_ReplyPubSubType, eprosima::fastdds::dds::builtin::TypeLookup_RequestPubSubType, eprosima::fastrtps::types::DynamicPubSubType
Public Functions
-
RTPS_DllAPI TopicDataType()
Constructor.
-
virtual RTPS_DllAPI ~TopicDataType()
Destructor.
- virtual RTPS_DllAPI bool serialize (void *data, fastrtps::rtps::SerializedPayload_t *payload)=0
Serialize method, it should be implemented by the user, since it is abstract. It is VERY IMPORTANT that the user sets the SerializedPayload length correctly.
- Parameters:
data – [in] Pointer to the data
payload – [out] Pointer to the payload
- Returns:
True if correct.
- virtual RTPS_DllAPI bool serialize (void *data, fastrtps::rtps::SerializedPayload_t *payload, DataRepresentationId_t data_representation)
Serialize method, it should be implemented by the user, since it is abstract. If not implemented, this method will call the serialize method in which the topic data representation is not considered. It is VERY IMPORTANT that the user sets the SerializedPayload length correctly.
- Parameters:
data – [in] Pointer to the data
payload – [out] Pointer to the payload
data_representation – [in] Representation that should be used to encode the data into the payload.
- Returns:
True if correct.
- virtual RTPS_DllAPI bool deserialize (fastrtps::rtps::SerializedPayload_t *payload, void *data)=0
Deserialize method, it should be implemented by the user, since it is abstract.
- Parameters:
payload – [in] Pointer to the payload
data – [out] Pointer to the data
- Returns:
True if correct.
- virtual RTPS_DllAPI std::function< uint32_t()> getSerializedSizeProvider (void *data)=0
Returns a function which can be used to calculate the serialized size of the provided data.
- Parameters:
data – [in] Pointer to data.
- Returns:
Functor which calculates the serialized size of the data.
- virtual RTPS_DllAPI std::function< uint32_t()> getSerializedSizeProvider (void *data, DataRepresentationId_t data_representation)
Returns a function which can be used to calculate the serialized size of the provided data.
- Parameters:
data – [in] Pointer to data.
data_representation – [in] Representation that should be used for calculating the serialized size.
- Returns:
Functor which calculates the serialized size of the data.
- virtual RTPS_DllAPI void * createData ()=0
Create a Data Type.
- Returns:
Void pointer to the created object.
- virtual RTPS_DllAPI void deleteData (void *data)=0
Remove a previously created object.
- Parameters:
data – Pointer to the created Data.
- virtual RTPS_DllAPI bool getKey (void *data, fastrtps::rtps::InstanceHandle_t *ihandle, bool force_md5=false)=0
Get the key associated with the data.
- Parameters:
data – [in] Pointer to the data.
ihandle – [out] Pointer to the Handle.
force_md5 – [in] Force MD5 checking.
- Returns:
True if correct.
- inline RTPS_DllAPI void setName (const char *nam)
Set topic data type name
- Parameters:
nam – Topic data type name
- inline RTPS_DllAPI const char * getName () const
Get topic data type name
- Returns:
Topic data type name
- inline RTPS_DllAPI bool auto_fill_type_object () const
Get the type object auto-fill configuration
- Returns:
true if the type object should be auto-filled
- inline RTPS_DllAPI void auto_fill_type_object (bool auto_fill_type_object)
Set the type object auto-fill configuration
- Parameters:
auto_fill_type_object – new value to set
- inline RTPS_DllAPI bool auto_fill_type_information () const
Get the type information auto-fill configuration
- Returns:
true if the type information should be auto-filled
- inline RTPS_DllAPI void auto_fill_type_information (bool auto_fill_type_information)
Set type information auto-fill configuration
- Parameters:
auto_fill_type_information – new value to set
- inline RTPS_DllAPI const std::shared_ptr< TypeIdV1 > type_identifier () const
Get the type identifier
- Returns:
- inline RTPS_DllAPI void type_identifier (const TypeIdV1 &id)
Set type identifier
- Parameters:
id – new value for TypeIdV1
- inline RTPS_DllAPI void type_identifier (const std::shared_ptr< TypeIdV1 > id)
Set type identifier
- Parameters:
id – shared pointer to TypeIdV1
- inline RTPS_DllAPI const std::shared_ptr< TypeObjectV1 > type_object () const
Get the type object
- Returns:
- inline RTPS_DllAPI void type_object (const TypeObjectV1 &object)
Set type object
- Parameters:
object – new value for TypeObjectV1
- inline RTPS_DllAPI void type_object (std::shared_ptr< TypeObjectV1 > object)
Set type object
- Parameters:
object – shared pointer to TypeObjectV1
- inline RTPS_DllAPI const std::shared_ptr< xtypes::TypeInformation > type_information () const
Get the type information
- Returns:
TypeInformation
- inline RTPS_DllAPI void type_information (const xtypes::TypeInformation &info)
Set type information
- Parameters:
info – new value for TypeInformation
- inline RTPS_DllAPI void type_information (std::shared_ptr< xtypes::TypeInformation > info)
Set type information
- Parameters:
info – shared pointer to TypeInformation
- inline virtual RTPS_DllAPI bool is_bounded () const
Checks if the type is bounded.
- inline virtual RTPS_DllAPI bool is_plain () const
Checks if the type is plain when using default encoding.
- inline virtual RTPS_DllAPI bool is_plain (DataRepresentationId_t) const
Checks if the type is plain when using a specific encoding.
- inline virtual RTPS_DllAPI bool construct_sample (void *memory) const
Construct a sample on a memory location.
- Parameters:
memory – Pointer to the memory location where the sample should be constructed.
- Returns:
whether this type supports in-place construction or not.
Public Members
-
uint32_t m_typeSize
Maximum serialized size of the type in bytes. If the type has unbounded fields, and therefore cannot have a maximum size, use 0.
-
bool m_isGetKeyDefined
Indicates whether the method to obtain the key has been implemented.
Protected Attributes
-
std::shared_ptr<TypeObjectV1> type_object_
Type Object XTYPES 1.1.
-
std::shared_ptr<xtypes::TypeInformation> type_information_
XTYPES 1.2.
Friends
- friend class fastdds::dds::TypeSupport
-
RTPS_DllAPI TopicDataType()