15.1.5.2. TopicDataType¶
-
class
eprosima::fastdds::dds
::
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
Public Functions
-
TopicDataType
()¶ Constructor.
-
~TopicDataType
()¶ Destructor.
-
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.
- Return
True if correct.
- Parameters
[in] data
: Pointer to the data[out] payload
: Pointer to the payload
-
bool
deserialize
(fastrtps::rtps::SerializedPayload_t *payload, void *data) = 0¶ Deserialize method, it should be implemented by the user, since it is abstract.
- Return
True if correct.
- Parameters
[in] payload
: Pointer to the payload[out] data
: Pointer to the data
-
std::function<uint32_t()>
getSerializedSizeProvider
(void *data) = 0¶ Gets the SerializedSizeProvider function.
- Return
function
- Parameters
data
: Pointer
-
void *
createData
() = 0¶ Create a Data Type.
- Return
Void pointer to the created object.
-
void
deleteData
(void *data) = 0¶ Remove a previously created object.
- Parameters
data
: Pointer to the created Data.
-
bool
getKey
(void *data, fastrtps::rtps::InstanceHandle_t *ihandle, bool force_md5 = false) = 0¶ Get the key associated with the data.
- Return
True if correct.
- Parameters
[in] data
: Pointer to the data.[out] ihandle
: Pointer to the Handle.[in] force_md5
: Force MD5 checking.
-
bool
auto_fill_type_object
() const¶ Get the type object auto-fill configuration
- Return
true if the type object should be auto-filled
-
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
-
bool
auto_fill_type_information
() const¶ Get the type information auto-fill configuration
- Return
true if the type information should be auto-filled
-
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
Set type identifier
- Parameters
id
: shared pointer to TypeIdV1
-
const std::shared_ptr<TypeObjectV1>
type_object
() const¶ Get the type object
- Return
-
void
type_object
(const TypeObjectV1 &object)¶ Set type object
- Parameters
object
: new value for TypeObjectV1
Set type object
- Parameters
object
: shared pointer to TypeObjectV1
-
const std::shared_ptr<xtypes::TypeInformation>
type_information
() const¶ Get the type information
- Return
TypeInformation
-
void
type_information
(const xtypes::TypeInformation &info)¶ Set type information
- Parameters
info
: new value for TypeInformation
Set type information
- Parameters
info
: shared pointer to TypeInformation
-
bool
is_bounded
() const¶ Checks if the type is bounded.
-
bool
is_plain
() const¶ Checks if the type is plain.
-
bool
construct_sample
(void *memory) const¶ Construct a sample on a memory location.
- Return
whether this type supports in-place construction or not.
- Parameters
memory
: Pointer to the memory location where the sample should be constructed.
-