Struct CDRMessage_t

Struct Documentation

struct CDRMessage_t

Structure CDRMessage_t, contains a serialized message.

Public Functions

inline CDRMessage_t()
inline ~CDRMessage_t()
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

inline CDRMessage_t(const CDRMessage_t &message)
inline CDRMessage_t(CDRMessage_t &&message)
inline CDRMessage_t &operator=(CDRMessage_t &&message)
inline void init(octet *buffer_ptr, uint32_t size)
inline void reserve(uint32_t size)

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.

bool wraps

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.