19#ifndef FASTDDS_DDS_TOPIC__TYPESUPPORT_HPP
20#define FASTDDS_DDS_TOPIC__TYPESUPPORT_HPP
26#include <fastdds/dds/common/InstanceHandle.hpp>
27#include <fastdds/dds/core/ReturnCode.hpp>
28#include <fastdds/dds/topic/TopicDataType.hpp>
29#include <fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp>
30#include <fastdds/fastdds_dll.hpp>
36class DomainParticipant;
50 using Base = std::shared_ptr<TopicDataType>;
122 std::string type_name)
const;
131 return get()->get_name();
143 const void*
const data,
166 const void*
const data,
169 return get()->calculate_serialized_size(data, data_representation);
179 return get()->create_data();
190 return get()->delete_data(data);
202 const void*
const data,
204 bool force_md5 =
false)
206 return get()->compute_key(data, i_handle, force_md5);
220 bool force_md5 =
false)
222 return get()->compute_key(payload, i_handle, force_md5);
228 return get()->max_serialized_type_size == type_support->max_serialized_type_size
229 && get()->is_compute_key_provided == type_support->is_compute_key_provided
230 && get()->get_name() == type_support->get_name()
231 && get()->type_identifiers() == type_support->type_identifiers();
239 FASTDDS_EXPORTED_API
bool empty()
const
241 return get() ==
nullptr;
249 return get()->is_bounded();
258 return get()->is_plain(data_representation);
262 std::nullptr_t)
const
268 std::nullptr_t)
const
Class DomainParticipant used to group Publishers and Subscribers into a single working unit.
Definition DomainParticipant.hpp:78
Class TopicDataType used to provide the DomainRTPSParticipant with the methods to serialize,...
Definition TopicDataType.hpp:61
Class TypeSupport used to provide the DomainRTPSParticipant with the methods to serialize,...
Definition TypeSupport.hpp:47
FASTDDS_EXPORTED_API TypeSupport() noexcept=default
Constructor.
FASTDDS_EXPORTED_API bool operator!=(std::nullptr_t) const
Definition TypeSupport.hpp:261
virtual FASTDDS_EXPORTED_API void * create_data()
Creates new data.
Definition TypeSupport.hpp:177
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 is_plain(DataRepresentationId_t data_representation) const
Checks if the type is plain when using a specific encoding.
Definition TypeSupport.hpp:255
virtual FASTDDS_EXPORTED_API bool compute_key(const void *const data, InstanceHandle_t &i_handle, bool force_md5=false)
Getter for the data key.
Definition TypeSupport.hpp:201
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.
Definition TypeSupport.hpp:165
virtual FASTDDS_EXPORTED_API const std::string & get_type_name() const
Getter for the type name.
Definition TypeSupport.hpp:129
FASTDDS_EXPORTED_API bool empty() const
Check if the TypeSupport is empty.
Definition TypeSupport.hpp:239
std::shared_ptr< TopicDataType > Base
Definition TypeSupport.hpp:50
virtual FASTDDS_EXPORTED_API bool is_bounded() const
Checks if the type is bounded.
Definition TypeSupport.hpp:247
virtual FASTDDS_EXPORTED_API ReturnCode_t register_type(DomainParticipant *participant) const
Registers the type on a participant.
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.
Definition TypeSupport.hpp:217
virtual FASTDDS_EXPORTED_API bool deserialize(fastdds::rtps::SerializedPayload_t &payload, void *data)
Deserializes the data.
virtual FASTDDS_EXPORTED_API bool operator==(const TypeSupport &type_support)
Definition TypeSupport.hpp:225
virtual FASTDDS_EXPORTED_API void delete_data(void *data)
Deletes data.
Definition TypeSupport.hpp:187
virtual FASTDDS_EXPORTED_API ReturnCode_t register_type(DomainParticipant *participant, std::string type_name) const
Registers the type on a participant.
Definition DomainParticipant.hpp:45
enum eprosima::fastdds::dds::DataRepresentationId DataRepresentationId_t
Enum DataRepresentationId, different kinds of topic data representation.
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
Definition EntityId_t.hpp:388
Struct InstanceHandle_t, used to contain the key for WITH_KEY topics.
Definition InstanceHandle.hpp:154
Structure SerializedPayload_t.
Definition SerializedPayload.hpp:59