19.1.5.1. TopicDataType
-
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::DynamicPubSubType, eprosima::fastdds::dds::xtypes::AppliedAnnotationParameterPubSubType, eprosima::fastdds::dds::xtypes::AppliedAnnotationPubSubType, eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotationsPubSubType, eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotationsPubSubType, eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotationPubSubType, eprosima::fastdds::dds::xtypes::CommonAliasBodyPubSubType, eprosima::fastdds::dds::xtypes::CommonAnnotationParameterPubSubType, eprosima::fastdds::dds::xtypes::CommonArrayHeaderPubSubType, eprosima::fastdds::dds::xtypes::CommonBitfieldPubSubType, eprosima::fastdds::dds::xtypes::CommonBitflagPubSubType, eprosima::fastdds::dds::xtypes::CommonBitmaskHeaderPubSubType, eprosima::fastdds::dds::xtypes::CommonCollectionElementPubSubType, eprosima::fastdds::dds::xtypes::CommonCollectionHeaderPubSubType, eprosima::fastdds::dds::xtypes::CommonDiscriminatorMemberPubSubType, eprosima::fastdds::dds::xtypes::CommonEnumeratedHeaderPubSubType, eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteralPubSubType, eprosima::fastdds::dds::xtypes::CommonStructMemberPubSubType, eprosima::fastdds::dds::xtypes::CommonUnionMemberPubSubType, eprosima::fastdds::dds::xtypes::CompleteAliasBodyPubSubType, eprosima::fastdds::dds::xtypes::CompleteAliasHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteAliasTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteAnnotationHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteAnnotationParameterPubSubType, eprosima::fastdds::dds::xtypes::CompleteAnnotationTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteArrayHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteArrayTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteBitfieldPubSubType, eprosima::fastdds::dds::xtypes::CompleteBitflagPubSubType, eprosima::fastdds::dds::xtypes::CompleteBitmaskTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteBitsetHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteBitsetTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteCollectionElementPubSubType, eprosima::fastdds::dds::xtypes::CompleteCollectionHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMemberPubSubType, eprosima::fastdds::dds::xtypes::CompleteElementDetailPubSubType, eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteralPubSubType, eprosima::fastdds::dds::xtypes::CompleteEnumeratedTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteExtendedTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteMapTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteMemberDetailPubSubType, eprosima::fastdds::dds::xtypes::CompleteSequenceTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteStructHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteStructMemberPubSubType, eprosima::fastdds::dds::xtypes::CompleteStructTypePubSubType, eprosima::fastdds::dds::xtypes::CompleteTypeDetailPubSubType, eprosima::fastdds::dds::xtypes::CompleteUnionHeaderPubSubType, eprosima::fastdds::dds::xtypes::CompleteUnionMemberPubSubType, eprosima::fastdds::dds::xtypes::CompleteUnionTypePubSubType, eprosima::fastdds::dds::xtypes::DummyPubSubType, eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValuePubSubType, eprosima::fastdds::dds::xtypes::ExtendedTypeDefnPubSubType, eprosima::fastdds::dds::xtypes::MinimalAliasBodyPubSubType, eprosima::fastdds::dds::xtypes::MinimalAliasHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalAliasTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalAnnotationHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalAnnotationParameterPubSubType, eprosima::fastdds::dds::xtypes::MinimalAnnotationTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalArrayHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalArrayTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalBitfieldPubSubType, eprosima::fastdds::dds::xtypes::MinimalBitflagPubSubType, eprosima::fastdds::dds::xtypes::MinimalBitmaskTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalBitsetHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalBitsetTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalCollectionElementPubSubType, eprosima::fastdds::dds::xtypes::MinimalCollectionHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMemberPubSubType, eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteralPubSubType, eprosima::fastdds::dds::xtypes::MinimalEnumeratedTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalExtendedTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalMapTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalMemberDetailPubSubType, eprosima::fastdds::dds::xtypes::MinimalSequenceTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalStructHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalStructMemberPubSubType, eprosima::fastdds::dds::xtypes::MinimalStructTypePubSubType, eprosima::fastdds::dds::xtypes::MinimalTypeDetailPubSubType, eprosima::fastdds::dds::xtypes::MinimalUnionHeaderPubSubType, eprosima::fastdds::dds::xtypes::MinimalUnionMemberPubSubType, eprosima::fastdds::dds::xtypes::MinimalUnionTypePubSubType, eprosima::fastdds::dds::xtypes::PlainArrayLElemDefnPubSubType, eprosima::fastdds::dds::xtypes::PlainArraySElemDefnPubSubType, eprosima::fastdds::dds::xtypes::PlainCollectionHeaderPubSubType, eprosima::fastdds::dds::xtypes::PlainMapLTypeDefnPubSubType, eprosima::fastdds::dds::xtypes::PlainMapSTypeDefnPubSubType, eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefnPubSubType, eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefnPubSubType, eprosima::fastdds::dds::xtypes::StringLTypeDefnPubSubType, eprosima::fastdds::dds::xtypes::StringSTypeDefnPubSubType, eprosima::fastdds::dds::xtypes::StronglyConnectedComponentIdPubSubType, eprosima::fastdds::dds::xtypes::TypeIdentfierWithSizePubSubType, eprosima::fastdds::dds::xtypes::TypeIdentifierPairPubSubType, eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPairPubSubType, eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependenciesPubSubType, eprosima::fastdds::dds::xtypes::TypeInformationPubSubType
Public Functions
-
TopicDataType() = default
Constructor.
-
virtual ~TopicDataType() = default
Destructor.
-
virtual bool serialize(const void *const data, rtps::SerializedPayload_t &payload, eprosima::fastdds::dds::DataRepresentationId_t data_representation) = 0
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 bool deserialize(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 uint32_t calculate_serialized_size(const void *const data, eprosima::fastdds::dds::DataRepresentationId_t data_representation) = 0
Calculates 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:
Serialized size of the data.
-
virtual void *create_data() = 0
Create a Data Type.
- Returns:
Void pointer to the created object.
-
virtual void delete_data(void *data) = 0
Remove a previously created object.
- Parameters:
data – Pointer to the created Data.
-
virtual bool compute_key(rtps::SerializedPayload_t &payload, rtps::InstanceHandle_t &ihandle, bool force_md5 = false) = 0
Get the key associated with the data.
- Parameters:
payload – [in] Pointer to the payload containing the data.
ihandle – [out] Pointer to the Handle.
force_md5 – [in] Force MD5 checking.
- Returns:
True if correct.
-
virtual bool compute_key(const void *const data, 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 void set_name(const std::string &nam)
Set topic data type name
- Parameters:
nam – Topic data type name
-
inline void set_name(std::string &&nam)
Set topic data type name
- Parameters:
nam – Topic data type name
-
inline const xtypes::TypeIdentifierPair &type_identifiers() const
Get the type identifiers
- Returns:
xtypes::TypeIdentifierPair
-
inline virtual bool is_bounded() const
Checks if the type is bounded.
-
inline virtual bool is_plain(DataRepresentationId_t) const
Checks if the type is plain when using a specific encoding.
-
inline virtual 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.
-
inline virtual void register_type_object_representation()
Register TypeObject type representation.
-
TopicDataType() = default