Class astutedds::cdr::XCDR2Encoder
ClassList > astutedds > cdr > XCDR2Encoder
XCDR2 encoding (CDR encapsulation version 2) More...
#include <xcdr2_codec.hpp>
Public Functions
| Type | Name |
|---|---|
| XCDR2Encoder (std::vector< uint8_t > & buffer, bool big_endian=false, ExtensibilityKind extensibility=ExtensibilityKind::FINAL) |
|
| void | begin_delimited () Begin encoding a delimited type (appendable or mutable) |
| void | encode_bool (bool value) |
| void | encode_double (double value) |
| void | encode_float (float value) |
| void | encode_int16 (int16_t value) |
| void | encode_int32 (int32_t value) |
| void | encode_int64 (int64_t value) |
| void | encode_int8 (int8_t value) |
| void | encode_member_header (uint32_t member_id, bool must_understand=false) Encode member header for mutable types ( EMHEADER ) |
| void | encode_sequence_length (uint32_t length) |
| void | encode_string (const std::string & str) |
| void | encode_uint16 (uint16_t value) |
| void | encode_uint32 (uint32_t value) |
| void | encode_uint64 (uint64_t value) |
| void | encode_uint8 (uint8_t value) |
| void | end_delimited () End encoding a delimited type. |
| size_t | size () const |
Detailed Description
XCDR2 supports delimited headers (DHEADER) for appendable and mutable types, enabling better type evolution and interoperability.
Key features: * 4-byte alignment for all members * DHEADER for appendable/mutable types * EMHEADER for mutable struct members
Public Functions Documentation
function XCDR2Encoder
inline astutedds::cdr::XCDR2Encoder::XCDR2Encoder (
std::vector< uint8_t > & buffer,
bool big_endian=false,
ExtensibilityKind extensibility=ExtensibilityKind::FINAL
)
function begin_delimited
Begin encoding a delimited type (appendable or mutable)
inline void astutedds::cdr::XCDR2Encoder::begin_delimited ()
Writes a DHEADER placeholder and pushes position to stack. Must be paired with end_delimited().
function encode_bool
inline void astutedds::cdr::XCDR2Encoder::encode_bool (
bool value
)
function encode_double
inline void astutedds::cdr::XCDR2Encoder::encode_double (
double value
)
function encode_float
inline void astutedds::cdr::XCDR2Encoder::encode_float (
float value
)
function encode_int16
inline void astutedds::cdr::XCDR2Encoder::encode_int16 (
int16_t value
)
function encode_int32
inline void astutedds::cdr::XCDR2Encoder::encode_int32 (
int32_t value
)
function encode_int64
inline void astutedds::cdr::XCDR2Encoder::encode_int64 (
int64_t value
)
function encode_int8
inline void astutedds::cdr::XCDR2Encoder::encode_int8 (
int8_t value
)
function encode_member_header
Encode member header for mutable types ( EMHEADER )
inline void astutedds::cdr::XCDR2Encoder::encode_member_header (
uint32_t member_id,
bool must_understand=false
)
Parameters:
member_idMember IDmust_understandMust-understand flag
function encode_sequence_length
inline void astutedds::cdr::XCDR2Encoder::encode_sequence_length (
uint32_t length
)
function encode_string
inline void astutedds::cdr::XCDR2Encoder::encode_string (
const std::string & str
)
function encode_uint16
inline void astutedds::cdr::XCDR2Encoder::encode_uint16 (
uint16_t value
)
function encode_uint32
inline void astutedds::cdr::XCDR2Encoder::encode_uint32 (
uint32_t value
)
function encode_uint64
inline void astutedds::cdr::XCDR2Encoder::encode_uint64 (
uint64_t value
)
function encode_uint8
inline void astutedds::cdr::XCDR2Encoder::encode_uint8 (
uint8_t value
)
function end_delimited
End encoding a delimited type.
inline void astutedds::cdr::XCDR2Encoder::end_delimited ()
Updates the DHEADER with actual size.
function size
inline size_t astutedds::cdr::XCDR2Encoder::size () const
The documentation for this class was generated from the following file include/astutedds/cdr/xcdr2_codec.hpp