18.1.5.9. TypeSupport¶
- class fastdds.TypeSupport(*args)¶
Notes: This class inherits from std::shared_ptr<TopicDataType>. 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.
- create_data()¶
Creates new data
- Return type
void
- Returns
Pointer to the data
- delete_data(data)¶
Deletes data
- Parameters
data (void) – Pointer to the data to delete
- deserialize(payload, data)¶
Deserializes the data
- Parameters
payload (eprosima::fastrtps::rtps::SerializedPayload_t) – Pointer to payload
data (void) – Pointer to data
- Return type
boolean
- Returns
true if it is deserialized correctly, false if not
- empty()¶
Check if the TypeSupport is empty
- Return type
boolean
- Returns
true if empty, false if not
- get_key(data, i_handle, force_md5=False)¶
Getter for the data key
- Parameters
data (void) – Pointer to data
i_handle (
InstanceHandle_t
) – InstanceHandle pointer to store the keyforce_md5 (boolean) – boolean to force md5 (default: false)
- Return type
boolean
- Returns
true if the key is returned, false if not
- get_serialized_size_provider(data)¶
Getter for the SerializedSizeProvider
- Parameters
data (void) – Pointer to data
- Return type
std::function< uint32_t () >
- Returns
function
- get_type_name()¶
Getter for the type name
- Return type
string
- Returns
name of the data type
- is_bounded()¶
Checks if the type is bounded.
- is_plain()¶
Checks if the type is plain.
- register_type(*args)¶
Overload 1:
Registers the type on a participant
- Parameters
participant (
DomainParticipant
) – DomainParticipant where the type is going to be registered- Return type
ReturnCode_t
- Returns
RETCODE_BAD_PARAMETER if the type name is empty, RETCODE_PRECONDITION_NOT_MET if there is another type with the same name registered on the DomainParticipant and RETCODE_OK if it is registered correctly
Overload 2:
Registers the type on a participant
- Parameters
participant (
DomainParticipant
) – DomainParticipant where the type is going to be registeredtype_name (string) – Name of the type to register
- Return type
ReturnCode_t
- Returns
RETCODE_BAD_PARAMETER if the type name is empty, RETCODE_PRECONDITION_NOT_MET if there is another type with the same name registered on the DomainParticipant and RETCODE_OK if it is registered correctly
- serialize(data, payload)¶
Serializes the data
- Parameters
data (void) – Pointer to data
payload (eprosima::fastrtps::rtps::SerializedPayload_t) – Pointer to payload
- Return type
boolean
- Returns
true if it is serialized correctly, false if not
- set(ptr)¶
- property thisown¶
The membership flag