19#ifndef FASTDDS_DDS_TOPIC__TOPICDATATYPE_HPP
20#define FASTDDS_DDS_TOPIC__TOPICDATATYPE_HPP
26#include <fastdds/dds/core/policy/QosPolicies.hpp>
27#include <fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp>
28#include <fastdds/fastdds_dll.hpp>
29#include <fastdds/rtps/common/CdrSerialization.hpp>
30#include <fastdds/rtps/common/InstanceHandle.hpp>
31#include <fastdds/rtps/common/SerializedPayload.hpp>
32#include <fastdds/utils/md5.hpp>
35#define TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
38#define TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
41#define TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
47struct SerializedPayload_t;
85 const void*
const data,
108 const void*
const data,
137 bool force_md5 =
false) = 0;
148 const void*
const data,
150 bool force_md5 =
false) = 0;
158 const std::string& nam)
160 topic_data_typename_ = nam;
171 topic_data_typename_ = std::move(nam);
179 FASTDDS_EXPORTED_API
inline const std::string&
get_name()
const
181 return topic_data_typename_;
221 static_cast<void>(memory);
246 std::string topic_data_typename_;
Class TopicDataType used to provide the DomainRTPSParticipant with the methods to serialize,...
Definition TopicDataType.hpp:61
virtual FASTDDS_EXPORTED_API 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.
virtual FASTDDS_EXPORTED_API bool construct_sample(void *memory) const
Construct a sample on a memory location.
Definition TopicDataType.hpp:218
FASTDDS_EXPORTED_API const xtypes::TypeIdentifierPair & type_identifiers() const
Get the type identifiers.
Definition TopicDataType.hpp:189
FASTDDS_EXPORTED_API void set_name(std::string &&nam)
Set topic data type name.
Definition TopicDataType.hpp:168
virtual FASTDDS_EXPORTED_API void register_type_object_representation()
Register TypeObject type representation.
Definition TopicDataType.hpp:228
virtual FASTDDS_EXPORTED_API void delete_data(void *data)=0
Remove a previously created object.
virtual FASTDDS_EXPORTED_API ~TopicDataType()=default
Destructor.
FASTDDS_EXPORTED_API const std::string & get_name() const
Get topic data type name.
Definition TopicDataType.hpp:179
bool is_compute_key_provided
Indicates whether the method to obtain the key has been implemented.
Definition TopicDataType.hpp:237
uint32_t max_serialized_type_size
Maximum serialized size of the type in bytes.
Definition TopicDataType.hpp:234
FASTDDS_EXPORTED_API TopicDataType()=default
Constructor.
virtual FASTDDS_EXPORTED_API 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.
xtypes::TypeIdentifierPair type_identifiers_
Definition TopicDataType.hpp:241
virtual FASTDDS_EXPORTED_API bool is_plain(DataRepresentationId_t) const
Checks if the type is plain when using a specific encoding.
Definition TopicDataType.hpp:205
virtual FASTDDS_EXPORTED_API void * create_data()=0
Create a Data Type.
virtual FASTDDS_EXPORTED_API bool compute_key(rtps::SerializedPayload_t &payload, rtps::InstanceHandle_t &ihandle, bool force_md5=false)=0
Get the key associated with the data.
virtual FASTDDS_EXPORTED_API bool is_bounded() const
Checks if the type is bounded.
Definition TopicDataType.hpp:197
virtual FASTDDS_EXPORTED_API bool deserialize(rtps::SerializedPayload_t &payload, void *data)=0
Deserialize method, it should be implemented by the user, since it is abstract.
virtual FASTDDS_EXPORTED_API bool compute_key(const void *const data, rtps::InstanceHandle_t &ihandle, bool force_md5=false)=0
Get the key associated with the data.
FASTDDS_EXPORTED_API void set_name(const std::string &nam)
Set topic data type name.
Definition TopicDataType.hpp:157
This class represents the structure TypeIdentifierPair defined by the user in the IDL file.
Definition dds_xtypes_typeobject.hpp:23845
Definition DomainParticipant.hpp:45
eprosima::fastdds::rtps::InstanceHandle_t InstanceHandle_t
Definition InstanceHandle.hpp:31
enum eprosima::fastdds::dds::DataRepresentationId DataRepresentationId_t
Enum DataRepresentationId, different kinds of topic data representation.
Struct InstanceHandle_t, used to contain the key for WITH_KEY topics.
Definition InstanceHandle.hpp:154
Structure SerializedPayload_t.
Definition SerializedPayload.hpp:59