18.2.3.3.1. CDRMessage_t

struct CDRMessage_t

Structure CDRMessage_t, contains a serialized message.

Public Functions

inline explicit CDRMessage_t(uint32_t size)

Constructor with maximum size

Parameters

size – Maximum size

inline explicit CDRMessage_t(const SerializedPayload_t &payload)

Constructor to wrap a serialized payload

Parameters

payload – Payload to wrap

Public Members

octet *buffer

Pointer to the buffer where the data is stored.

uint32_t pos

Read or write position.

uint32_t max_size

Max size of the message.

uint32_t reserved_size

Size allocated on buffer. May be higher than max_size.

uint32_t length

Current length of the message.

Endianness_t msg_endian

Endianness of the message.

Public Static Functions

static inline CDRMessage_t wrap_from_other_message(const CDRMessage_t &other, uint32_t length_from_current_position)

Wraps a portion of a CDRMessage_t into a new CDRMessage_t.

Note: If the specified length exceeds the available data in other, the returned CDRMessage_t will have length zero and buffer set to nullptr.

Parameters
  • other – The CDRMessage_t to wrap from.

  • length_from_current_position – The length of the portion to wrap, starting from the current position of other.

Returns

A new CDRMessage_t wrapping the specified portion.