19#ifndef FASTDDS_RTPS_COMMON__SERIALIZEDPAYLOAD_HPP
20#define FASTDDS_RTPS_COMMON__SERIALIZEDPAYLOAD_HPP
29#include <fastdds/fastdds_dll.hpp>
30#include <fastdds/rtps/common/Types.hpp>
31#include <fastdds/rtps/history/IPayloadPool.hpp>
45#define PL_CDR_BE 0x0002
46#define PL_CDR_LE 0x0003
48#if FASTDDS_IS_BIG_ENDIAN_TARGET
49#define DEFAULT_ENCAPSULATION CDR_BE
50#define PL_DEFAULT_ENCAPSULATION PL_CDR_BE
52#define DEFAULT_ENCAPSULATION CDR_LE
53#define PL_DEFAULT_ENCAPSULATION PL_CDR_LE
61 static constexpr size_t representation_header_size = 4u;
78 : encapsulation(CDR_BE)
107 *
this = std::move(other);
131 bool with_limit =
true);
An interface for classes responsible of serialized payload management.
Definition IPayloadPool.hpp:35
unsigned char octet
Definition Types.hpp:83
Structure SerializedPayload_t.
Definition SerializedPayload.hpp:59
octet * data
Pointer to the data.
Definition SerializedPayload.hpp:68
bool copy(const SerializedPayload_t *serData, bool with_limit=true)
Copy another structure (including allocating new space for the data).
SerializedPayload_t(uint32_t len)
Definition SerializedPayload.hpp:89
uint16_t encapsulation
Encapsulation of the data as suggested in the RTPS 2.1 specification chapter 10.
Definition SerializedPayload.hpp:64
uint32_t max_size
Maximum size of the payload.
Definition SerializedPayload.hpp:70
bool reserve_fragmented(SerializedPayload_t *serData)
Allocate new space for fragmented data.
void reserve(uint32_t new_size)
SerializedPayload_t(SerializedPayload_t &&other) noexcept
Move constructor.
Definition SerializedPayload.hpp:104
SerializedPayload_t(const SerializedPayload_t &other)=delete
Copy constructor.
void empty()
Empty the payload.
SerializedPayload_t()
Default constructor.
Definition SerializedPayload.hpp:77
uint32_t length
Actual length of the data.
Definition SerializedPayload.hpp:66
uint32_t pos
Position when reading.
Definition SerializedPayload.hpp:72
~SerializedPayload_t()
Destructor It is expected to release the payload if the payload owner is not nullptr before destructi...