Class TypeSupport 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. More...
#include <TypeSupport.hpp>
Public Types | |
using | Base = std::shared_ptr< TopicDataType > |
Public Member Functions | |
FASTDDS_EXPORTED_API | TypeSupport () noexcept=default |
Constructor. | |
FASTDDS_EXPORTED_API | TypeSupport (const TypeSupport &type) noexcept=default |
Copy Constructor. | |
FASTDDS_EXPORTED_API | TypeSupport (TypeSupport &&type) noexcept=default |
Move Constructor. | |
FASTDDS_EXPORTED_API TypeSupport & | operator= (const TypeSupport &type) noexcept=default |
Copy Assignment. | |
FASTDDS_EXPORTED_API TypeSupport & | operator= (TypeSupport &&type) noexcept=default |
Move Assignment. | |
FASTDDS_EXPORTED_API | TypeSupport (TopicDataType *ptr) |
TypeSupport constructor that receives a TopicDataType pointer. | |
virtual FASTDDS_EXPORTED_API ReturnCode_t | register_type (DomainParticipant *participant) const |
Registers the type on a participant. | |
virtual FASTDDS_EXPORTED_API ReturnCode_t | register_type (DomainParticipant *participant, std::string type_name) const |
Registers the type on a participant. | |
virtual FASTDDS_EXPORTED_API const std::string & | get_type_name () const |
Getter for the type name. | |
virtual FASTDDS_EXPORTED_API bool | serialize (const void *const data, fastdds::rtps::SerializedPayload_t &payload, DataRepresentationId_t data_representation) |
Serializes the data. | |
virtual FASTDDS_EXPORTED_API bool | deserialize (fastdds::rtps::SerializedPayload_t &payload, void *data) |
Deserializes the data. | |
virtual FASTDDS_EXPORTED_API uint32_t | calculate_serialized_size (const void *const data, DataRepresentationId_t data_representation) |
Returns a function which can be used to calculate the serialized size of the provided data. | |
virtual FASTDDS_EXPORTED_API void * | create_data () |
Creates new data. | |
virtual FASTDDS_EXPORTED_API void | delete_data (void *data) |
Deletes data. | |
virtual FASTDDS_EXPORTED_API bool | compute_key (const void *const data, InstanceHandle_t &i_handle, bool force_md5=false) |
Getter for the data key. | |
virtual FASTDDS_EXPORTED_API bool | compute_key (fastdds::rtps::SerializedPayload_t &payload, InstanceHandle_t &i_handle, bool force_md5=false) |
Getter for the data key. | |
virtual FASTDDS_EXPORTED_API bool | operator== (const TypeSupport &type_support) |
FASTDDS_EXPORTED_API bool | empty () const |
Check if the TypeSupport is empty. | |
virtual FASTDDS_EXPORTED_API bool | is_bounded () const |
Checks if the type is bounded. | |
virtual FASTDDS_EXPORTED_API bool | is_plain (DataRepresentationId_t data_representation) const |
Checks if the type is plain when using a specific encoding. | |
FASTDDS_EXPORTED_API bool | operator!= (std::nullptr_t) const |
FASTDDS_EXPORTED_API bool | operator== (std::nullptr_t) const |
Class TypeSupport 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.
using Base = std::shared_ptr<TopicDataType> |
|
defaultnoexcept |
Constructor.
|
defaultnoexcept |
Copy Constructor.
type | Another instance of TypeSupport |
|
defaultnoexcept |
Move Constructor.
type | Another instance of TypeSupport |
|
inlineexplicit |
TypeSupport constructor that receives a TopicDataType pointer.
The passed pointer will be managed by the TypeSupport object, so creating two TypeSupport from the same pointer or deleting the passed pointer will produce a runtime error.
ptr |
|
inlinevirtual |
Returns a function which can be used to calculate the serialized size of the provided data.
[in] | data | Pointer to data. |
[in] | data_representation | Representation that should be used for calculating the serialized size. |
|
inlinevirtual |
Getter for the data key.
data | Pointer to serialized payload containing the data. |
i_handle | InstanceHandle pointer to store the key |
force_md5 | boolean to force md5 (default: false) |
|
inlinevirtual |
Getter for the data key.
payload | Pointer to data |
i_handle | InstanceHandle pointer to store the key |
force_md5 | boolean to force md5 (default: false) |
|
inlinevirtual |
Creates new data.
|
inlinevirtual |
Deletes data.
data | Pointer to the data to delete |
|
virtual |
Deserializes the data.
payload | Pointer to payload |
data | Pointer to data |
|
inline |
Check if the TypeSupport is empty.
|
inlinevirtual |
Getter for the type name.
|
inlinevirtual |
Checks if the type is bounded.
|
inlinevirtual |
Checks if the type is plain when using a specific encoding.
|
inline |
|
defaultnoexcept |
Copy Assignment.
type | Another instance of TypeSupport |
|
defaultnoexcept |
Move Assignment.
type | Another instance of TypeSupport |
|
inlinevirtual |
|
inline |
|
virtual |
Registers the type on a participant.
participant | DomainParticipant where the type is going to be registered |
|
virtual |
Registers the type on a participant.
participant | DomainParticipant where the type is going to be registered |
type_name | Name of the type to register |
|
virtual |
Serializes the data.
data | Pointer to data | |
payload | Pointer to payload | |
[in] | data_representation | Representation that should be used to encode the data into the payload. |