Safe DDS
eprosima::safedds::serialization::cdr::Serializer Class Reference

CDR(Common Data Representation) Serializer implementation. More...

#include <Serializer.hpp>

Public Member Functions

 Serializer (memory::IByteArrayView &buffer) noexcept
 Serializer constructor. More...
 
virtual ~Serializer () noexcept=default
 Virtual destructor.
 
 Serializer (const Serializer &) noexcept=delete
 Copy deleted.
 
 Serializer (Serializer &&) noexcept=delete
 Movement deleted.
 
Serializeroperator= (const Serializer &) noexcept=delete
 Copy operator deleted.
 
Serializeroperator= (Serializer &&) noexcept=delete
 Movement operator deleted due private references.
 
ReturnCode serializer_skip (size_t size) noexcept override
 Skips slice in serialization process. More...
 
ReturnCode serializer_align_to (uint32_t type_size) noexcept override
 Aligns serializer position. More...
 
size_t serializer_remaining_size () noexcept override
 Returns remaining available size of serializer. More...
 
size_t serializer_used_size () noexcept override
 Gets serializer used size. More...
 
ReturnCode serialize (char value) noexcept override
 Serialize a single variable, implementations for each supported type: char bool uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t float double. More...
 
ReturnCode serialize (bool value) noexcept override
 Serialize a single bool. More...
 
ReturnCode serialize (uint8_t value) noexcept override
 Serialize a single uint8_t. More...
 
ReturnCode serialize (uint16_t value) noexcept override
 Serialize a single uint16_t. More...
 
ReturnCode serialize (uint32_t value) noexcept override
 Serialize a single uint32_t. More...
 
ReturnCode serialize (uint64_t value) noexcept override
 Serialize a single uint64_t. More...
 
ReturnCode serialize (int8_t value) noexcept override
 Serialize a single int8_t. More...
 
ReturnCode serialize (int16_t value) noexcept override
 Serialize a single int16_t. More...
 
ReturnCode serialize (int32_t value) noexcept override
 Serialize a single int32_t. More...
 
ReturnCode serialize (int64_t value) noexcept override
 Serialize a single int64_t. More...
 
ReturnCode serialize (float value) noexcept override
 Serialize a single float. More...
 
ReturnCode serialize (double value) noexcept override
 Serialize a single double. More...
 
ReturnCode serialize_array (const char *value, size_t size) noexcept override
 Serialize array, implementations for each supported type: char bool uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t float double. More...
 
ReturnCode serialize_array (const bool *value, size_t size) noexcept override
 Serialize bool array. More...
 
ReturnCode serialize_array (const uint8_t *value, size_t size) noexcept override
 Serialize uint8_t array. More...
 
ReturnCode serialize_array (const uint16_t *value, size_t size) noexcept override
 Serialize uint16_t array. More...
 
ReturnCode serialize_array (const uint32_t *value, size_t size) noexcept override
 Serialize uint32_t array. More...
 
ReturnCode serialize_array (const uint64_t *value, size_t size) noexcept override
 Serialize uint64_t array. More...
 
ReturnCode serialize_array (const int8_t *value, size_t size) noexcept override
 Serialize int8_t array. More...
 
ReturnCode serialize_array (const int16_t *value, size_t size) noexcept override
 Serialize int16_t array. More...
 
ReturnCode serialize_array (const int32_t *value, size_t size) noexcept override
 Serialize int32_t array. More...
 
ReturnCode serialize_array (const int64_t *value, size_t size) noexcept override
 Serialize int64_t array. More...
 
ReturnCode serialize_array (const float *value, size_t size) noexcept override
 Serialize float array. More...
 
ReturnCode serialize_array (const double *value, size_t size) noexcept override
 Serialize double array. More...
 
ReturnCode serialize_sequence (const char *value, uint32_t size) noexcept override
 Serialize sequence, implementations for each supported type: char bool uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t float double. More...
 
ReturnCode serialize_sequence (const bool *value, uint32_t size) noexcept override
 Serialize bool sequence. More...
 
ReturnCode serialize_sequence (const uint8_t *value, uint32_t size) noexcept override
 Serialize uint8_t sequence. More...
 
ReturnCode serialize_sequence (const uint16_t *value, uint32_t size) noexcept override
 Serialize uint16_t sequence. More...
 
ReturnCode serialize_sequence (const uint32_t *value, uint32_t size) noexcept override
 Serialize uint32_t sequence. More...
 
ReturnCode serialize_sequence (const uint64_t *value, uint32_t size) noexcept override
 Serialize uint64_t sequence. More...
 
ReturnCode serialize_sequence (const int8_t *value, uint32_t size) noexcept override
 Serialize int8_t sequence. More...
 
ReturnCode serialize_sequence (const int16_t *value, uint32_t size) noexcept override
 Serialize int16_t sequence. More...
 
ReturnCode serialize_sequence (const int32_t *value, uint32_t size) noexcept override
 Serialize int32_t sequence. More...
 
ReturnCode serialize_sequence (const int64_t *value, uint32_t size) noexcept override
 Serialize int64_t sequence. More...
 
ReturnCode serialize_sequence (const float *value, uint32_t size) noexcept override
 Serialize float sequence. More...
 
ReturnCode serialize_sequence (const double *value, uint32_t size) noexcept override
 Serialize double sequence. More...
 

Additional Inherited Members

- Protected Member Functions inherited from eprosima::safedds::serialization::ISerializer
 ~ISerializer () noexcept=default
 Protected destructor ownership defined on creation.
 
 ISerializer () noexcept=default
 Default creation.
 
 ISerializer (const ISerializer &) noexcept=delete
 Copy deleted.
 
 ISerializer (ISerializer &&) noexcept=delete
 Movement deleted.
 
ISerializeroperator= (const ISerializer &) noexcept=delete
 Copy operator deleted.
 
ISerializeroperator= (ISerializer &&) noexcept=delete
 Movement operator deleted.
 

Detailed Description

CDR(Common Data Representation) Serializer implementation.

Constructor & Destructor Documentation

◆ Serializer()

eprosima::safedds::serialization::cdr::Serializer::Serializer ( memory::IByteArrayView buffer)
inlineexplicitnoexcept

Serializer constructor.

Parameters
[in,out]bufferview of the serialization buffer. Ownership is not taken.

Member Function Documentation

◆ serialize() [1/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( bool  value)
overridevirtualnoexcept

Serialize a single bool.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [2/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( char  value)
overridevirtualnoexcept

Serialize a single variable, implementations for each supported type: char bool uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t float double.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [3/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( double  value)
overridevirtualnoexcept

Serialize a single double.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [4/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( float  value)
overridevirtualnoexcept

Serialize a single float.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [5/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( int16_t  value)
overridevirtualnoexcept

Serialize a single int16_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [6/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( int32_t  value)
overridevirtualnoexcept

Serialize a single int32_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [7/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( int64_t  value)
overridevirtualnoexcept

Serialize a single int64_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [8/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( int8_t  value)
overridevirtualnoexcept

Serialize a single int8_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [9/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( uint16_t  value)
overridevirtualnoexcept

Serialize a single uint16_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [10/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( uint32_t  value)
overridevirtualnoexcept

Serialize a single uint32_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [11/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( uint64_t  value)
overridevirtualnoexcept

Serialize a single uint64_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize() [12/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize ( uint8_t  value)
overridevirtualnoexcept

Serialize a single uint8_t.

Parameters
valuevariable to serialize.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [1/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const bool *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize bool array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [2/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const char *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize array, implementations for each supported type: char bool uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t float double.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [3/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const double *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize double array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [4/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const float *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize float array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [5/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const int16_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize int16_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [6/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const int32_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize int32_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [7/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const int64_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize int64_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [8/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const int8_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize int8_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [9/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const uint16_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize uint16_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [10/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const uint32_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize uint32_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [11/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const uint64_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize uint64_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_array() [12/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_array ( const uint8_t *  value,
size_t  size 
)
overridevirtualnoexcept

Serialize uint8_t array.

Parameters
[in]valuepointer to array to serialize.
sizesize of the array that is going to be serialized.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [1/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const bool *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize bool sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [2/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const char *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize sequence, implementations for each supported type: char bool uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t float double.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [3/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const double *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize double sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [4/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const float *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize float sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [5/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const int16_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize int16_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [6/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const int32_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize int32_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [7/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const int64_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize int64_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [8/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const int8_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize int8_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [9/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const uint16_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize uint16_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [10/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const uint32_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize uint32_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [11/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const uint64_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize uint64_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serialize_sequence() [12/12]

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serialize_sequence ( const uint8_t *  value,
uint32_t  size 
)
overridevirtualnoexcept

Serialize uint8_t sequence.

Parameters
[in]valuepointer to sequence to serialize.
sizeserialized size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serializer_align_to()

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serializer_align_to ( uint32_t  type_size)
overridevirtualnoexcept

Aligns serializer position.

Parameters
type_sizetype size.
Returns
ReturnCode.

Implements eprosima::safedds::serialization::ISerializer.

◆ serializer_remaining_size()

size_t eprosima::safedds::serialization::cdr::Serializer::serializer_remaining_size ( )
overridevirtualnoexcept

Returns remaining available size of serializer.

Returns
Remaining size.

Implements eprosima::safedds::serialization::ISerializer.

◆ serializer_skip()

ReturnCode eprosima::safedds::serialization::cdr::Serializer::serializer_skip ( size_t  size)
overridevirtualnoexcept

Skips slice in serialization process.

Parameters
sizesize to skip
Returns
ReturnCode

Implements eprosima::safedds::serialization::ISerializer.

◆ serializer_used_size()

size_t eprosima::safedds::serialization::cdr::Serializer::serializer_used_size ( )
overridevirtualnoexcept

Gets serializer used size.

Returns
Used size.

Implements eprosima::safedds::serialization::ISerializer.


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