| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
SerializedPayload_t Struct Reference
eProsima Fast DDS API Reference » RTPS » Common Module.

Structure SerializedPayload_t. More...

`#include <SerializedPayload.hpp>`

## Public Member Functions

| SerializedPayload_t ()
| Default constructor.
| SerializedPayload_t (uint32_t len)
| SerializedPayload_t (const SerializedPayload_t &other)=delete
| Copy constructor.
SerializedPayload_t & | operator= (const SerializedPayload_t &other)=delete
| Copy operator.
| SerializedPayload_t (SerializedPayload_t &&other) noexcept
| Move constructor.
SerializedPayload_t & | operator= (SerializedPayload_t &&other) noexcept
| Move operator.
| ~SerializedPayload_t ()
| Destructor It is expected to release the payload if the payload owner is not nullptr before destruction.
bool | operator== (const SerializedPayload_t &other) const
bool | copy (const SerializedPayload_t *serData, bool with_limit=true)
| Copy another structure (including allocating new space for the data).
bool | reserve_fragmented (SerializedPayload_t *serData)
| Allocate new space for fragmented data.
void | empty ()
| Empty the payload.
void | reserve (uint32_t new_size)

## Public Attributes

uint16_t | encapsulation
| Encapsulation of the data as suggested in the RTPS 2.1 specification chapter 10.
uint32_t | length
| Actual length of the data.
octet * | data
| Pointer to the data.
uint32_t | max_size
| Maximum size of the payload.
uint32_t | pos
| Position when reading.
IPayloadPool * | payload_owner = nullptr
| Pool that created the payload.
bool | is_serialized_key = false
| Whether the payload contains a serialized key, or the whole data.

## Static Public Attributes

static constexpr size_t | representation_header_size = 4u
| Size in bytes of the representation header as specified in the RTPS 2.3 specification chapter 10.

## Detailed Description

Structure SerializedPayload_t.

## Constructor & Destructor Documentation

## ◆ SerializedPayload_t() [1/4]

SerializedPayload_t | ( |  | ) |

inline

Default constructor.

## ◆ SerializedPayload_t() [2/4]

SerializedPayload_t | ( | uint32_t | len | ) |

inline explicit

Parameters

  len | Maximum size of the payload

## ◆ SerializedPayload_t() [3/4]

SerializedPayload_t | ( | const SerializedPayload_t & | other | ) |

delete

Copy constructor.

## ◆ SerializedPayload_t() [4/4]

SerializedPayload_t | ( | SerializedPayload_t && | other | ) |

inline noexcept

Move constructor.

## ◆ ~SerializedPayload_t()

~SerializedPayload_t | ( |  | ) |

Destructor It is expected to release the payload if the payload owner is not nullptr before destruction.

## Member Function Documentation

## ◆ copy()

bool copy | ( | const SerializedPayload_t * | serData,
|  | bool | with_limit = true )

Copy another structure (including allocating new space for the data).

Parameters

  [in] | serData | Pointer to the structure to copy
  | with_limit | if true, the function will fail when providing a payload too big

Returns
  True if correct

## ◆ empty()

void empty | ( |  | ) |

Empty the payload.

Precondition
  payload_owner must be nullptr

## ◆ operator=() [1/2]

SerializedPayload_t & operator= | ( | const SerializedPayload_t & | other | ) |

delete

Copy operator.

## ◆ operator=() [2/2]

SerializedPayload_t & operator= | ( | SerializedPayload_t && | other | ) |

noexcept

Move operator.

## ◆ operator==()

bool operator== | ( | const SerializedPayload_t & | other | ) | const

## ◆ reserve()

void reserve | ( | uint32_t | new_size | ) |

## ◆ reserve_fragmented()

bool reserve_fragmented | ( | SerializedPayload_t * | serData | ) |

Allocate new space for fragmented data.

Parameters

  [in] | serData | Pointer to the structure to copy

Returns
  True if correct

## Member Data Documentation

## ◆ data

octet* data

Pointer to the data.

## ◆ encapsulation

uint16_t encapsulation

Encapsulation of the data as suggested in the RTPS 2.1 specification chapter 10.

## ◆ is_serialized_key

bool is_serialized_key = false

Whether the payload contains a serialized key, or the whole data.

## ◆ length

uint32_t length

Actual length of the data.

## ◆ max_size

uint32_t max_size

Maximum size of the payload.

## ◆ payload_owner

IPayloadPool* payload_owner = nullptr

Pool that created the payload.

## ◆ pos

uint32_t pos

Position when reading.

## ◆ representation_header_size

size_t representation_header_size = 4u

static constexpr

Size in bytes of the representation header as specified in the RTPS 2.3 specification chapter 10.

The documentation for this struct was generated from the following file:

- include/fastdds/rtps/common/SerializedPayload.hpp