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

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

#include <Deserializer.hpp>

Public Member Functions

 Deserializer (const memory::IConstByteArrayView &buffer, bool native_endianness) noexcept
 Deserializer constructor. More...
 
virtual ~Deserializer () noexcept=default
 Virtual destructor.
 
 Deserializer (const Deserializer &) noexcept=delete
 Copy deleted.
 
 Deserializer (Deserializer &&) noexcept=delete
 Movement deleted.
 
Deserializeroperator= (const Deserializer &) noexcept=delete
 Copy operator deleted.
 
Deserializeroperator= (Deserializer &&) noexcept=delete
 Movement operator deleted due private references.
 
size_t deserializer_size () const noexcept override
 Returns size of deserializer. More...
 
size_t deserializer_remaining_size () const noexcept override
 Returns remaining available size of deserializer. More...
 
size_t deserializer_used_size () const noexcept override
 Gets deserializer used size. More...
 
ReturnCode deserializer_skip (size_t size) noexcept override
 Skips slice in deserialization process. More...
 
ReturnCode deserializer_skip (size_t size, memory::IConstMutableByteArrayView &view) noexcept override
 Skips slice in deserialization process and returns skipped slice to the user. More...
 
bool is_native_endianess () const noexcept override
 Checks if deserializer is in native endianness. More...
 
ReturnCode deserialize (char &value) noexcept override
 Deserialize 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 deserialize (bool &value) noexcept override
 Deserialize a single bool. More...
 
ReturnCode deserialize (uint8_t &value) noexcept override
 Deserialize a single uint8_t. More...
 
ReturnCode deserialize (uint16_t &value) noexcept override
 Deserialize a single uint16_t. More...
 
ReturnCode deserialize (uint32_t &value) noexcept override
 Deserialize a single uint32_t. More...
 
ReturnCode deserialize (uint64_t &value) noexcept override
 Deserialize a single uint64_t. More...
 
ReturnCode deserialize (int8_t &value) noexcept override
 Deserialize a single int8_t. More...
 
ReturnCode deserialize (int16_t &value) noexcept override
 Deserialize a single int16_t. More...
 
ReturnCode deserialize (int32_t &value) noexcept override
 Deserialize a single int32_t. More...
 
ReturnCode deserialize (int64_t &value) noexcept override
 Deserialize a single int64_t. More...
 
ReturnCode deserialize (float &value) noexcept override
 Deserialize a single float. More...
 
ReturnCode deserialize (double &value) noexcept override
 Deserialize a single double. More...
 
ReturnCode deserialize_array (char *value, size_t size) noexcept override
 Deserialize 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 deserialize_array (bool *value, size_t size) noexcept override
 Deserialize bool array: More...
 
ReturnCode deserialize_array (uint8_t *value, size_t size) noexcept override
 Deserialize uint8_t array: More...
 
ReturnCode deserialize_array (uint16_t *value, size_t size) noexcept override
 Deserialize uint16_t array: More...
 
ReturnCode deserialize_array (uint32_t *value, size_t size) noexcept override
 Deserialize uint32_t array: More...
 
ReturnCode deserialize_array (uint64_t *value, size_t size) noexcept override
 Deserialize uint64_t array: More...
 
ReturnCode deserialize_array (int8_t *value, size_t size) noexcept override
 Deserialize int8_t array: More...
 
ReturnCode deserialize_array (int16_t *value, size_t size) noexcept override
 Deserialize int16_t array: More...
 
ReturnCode deserialize_array (int32_t *value, size_t size) noexcept override
 Deserialize int32_t array: More...
 
ReturnCode deserialize_array (int64_t *value, size_t size) noexcept override
 Deserialize int64_t array: More...
 
ReturnCode deserialize_array (float *value, size_t size) noexcept override
 Deserialize float array: More...
 
ReturnCode deserialize_array (double *value, size_t size) noexcept override
 Deserialize double array: More...
 
ReturnCode deserialize_sequence (char *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize 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 deserialize_sequence (bool *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize bool sequence. More...
 
ReturnCode deserialize_sequence (uint8_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize uint8_t sequence. More...
 
ReturnCode deserialize_sequence (uint16_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize uint16_t sequence. More...
 
ReturnCode deserialize_sequence (uint32_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize uint32_t sequence. More...
 
ReturnCode deserialize_sequence (uint64_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize uint64_t sequence. More...
 
ReturnCode deserialize_sequence (int8_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize int8_t sequence. More...
 
ReturnCode deserialize_sequence (int16_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize int16_t sequence. More...
 
ReturnCode deserialize_sequence (int32_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize int32_t sequence. More...
 
ReturnCode deserialize_sequence (int64_t *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize int64_t sequence. More...
 
ReturnCode deserialize_sequence (float *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize float sequence. More...
 
ReturnCode deserialize_sequence (double *value, size_t capacity, uint32_t &size) noexcept override
 Deserialize double sequence. More...
 

Additional Inherited Members

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

Detailed Description

CDR(Common Data Representation) Deserializer implementation.

Constructor & Destructor Documentation

◆ Deserializer()

eprosima::safedds::serialization::cdr::Deserializer::Deserializer ( const memory::IConstByteArrayView buffer,
bool  native_endianness 
)
inlineexplicitnoexcept

Deserializer constructor.

Parameters
[in]bufferconst view of the deserialization buffer. Ownership is not taken.
native_endiannesswether we deserialize in native endianess or not.

Member Function Documentation

◆ deserialize() [1/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( bool &  value)
overridevirtualnoexcept

Deserialize a single bool.

Parameters
[out]valuebool variable to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [2/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( char &  value)
overridevirtualnoexcept

Deserialize 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
[out]valuevariable to save deserialized value
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [3/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( double &  value)
overridevirtualnoexcept

Deserialize a single double.

Parameters
[out]valuedouble to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [4/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( float &  value)
overridevirtualnoexcept

Deserialize a single float.

Parameters
[out]valuefloat to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [5/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( int16_t &  value)
overridevirtualnoexcept

Deserialize a single int16_t.

Parameters
[out]valueint16_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [6/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( int32_t &  value)
overridevirtualnoexcept

Deserialize a single int32_t.

Parameters
[out]valueint32_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [7/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( int64_t &  value)
overridevirtualnoexcept

Deserialize a single int64_t.

Parameters
[out]valueint64_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [8/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( int8_t &  value)
overridevirtualnoexcept

Deserialize a single int8_t.

Parameters
[out]valueint8_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [9/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( uint16_t &  value)
overridevirtualnoexcept

Deserialize a single uint16_t.

Parameters
[out]valueuint16_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [10/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( uint32_t &  value)
overridevirtualnoexcept

Deserialize a single uint32_t.

Parameters
[out]valueuint32_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [11/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( uint64_t &  value)
overridevirtualnoexcept

Deserialize a single uint64_t.

Parameters
[out]valueuint64_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize() [12/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize ( uint8_t &  value)
overridevirtualnoexcept

Deserialize a single uint8_t.

Parameters
[out]valueuint8_t to deserialize.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [1/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( bool *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize bool array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [2/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( char *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize 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
valuepointer to store deserialized array
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [3/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( double *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize double array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [4/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( float *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize float array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [5/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( int16_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize int16_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [6/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( int32_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize int32_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [7/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( int64_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize int64_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [8/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( int8_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize int8_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [9/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( uint16_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize uint16_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [10/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( uint32_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize uint32_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [11/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( uint64_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize uint64_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_array() [12/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_array ( uint8_t *  value,
size_t  size 
)
overridevirtualnoexcept

Deserialize uint8_t array:

Parameters
valuepointer to output deserialized array.
sizesize of the array.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [1/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( bool *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize bool sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [2/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( char *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize 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
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [3/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( double *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize double sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [4/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( float *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize float sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [5/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( int16_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize int16_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [6/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( int32_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize int32_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [7/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( int64_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize int64_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [8/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( int8_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize int8_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [9/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( uint16_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize uint16_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [10/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( uint32_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize uint32_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [11/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( uint64_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize uint64_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserialize_sequence() [12/12]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserialize_sequence ( uint8_t *  value,
size_t  capacity,
uint32_t &  size 
)
overridevirtualnoexcept

Deserialize uint8_t sequence.

Parameters
[out]valuepointer to store deserialized sequence.
capacityavailable capacity on the value pointer.
[out]size: deserialized sequence size.
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserializer_remaining_size()

size_t eprosima::safedds::serialization::cdr::Deserializer::deserializer_remaining_size ( ) const
overridevirtualnoexcept

Returns remaining available size of deserializer.

Returns
Remaining size

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserializer_size()

size_t eprosima::safedds::serialization::cdr::Deserializer::deserializer_size ( ) const
overridevirtualnoexcept

Returns size of deserializer.

Returns
Deserializer size

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserializer_skip() [1/2]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserializer_skip ( size_t  size)
overridevirtualnoexcept

Skips slice in deserialization process.

Parameters
sizesize to skip
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserializer_skip() [2/2]

ReturnCode eprosima::safedds::serialization::cdr::Deserializer::deserializer_skip ( size_t  size,
memory::IConstMutableByteArrayView view 
)
overridevirtualnoexcept

Skips slice in deserialization process and returns skipped slice to the user.

Parameters
sizesize to skip
[out]viewskiped view
Returns
ReturnCode

Implements eprosima::safedds::serialization::IDeserializer.

◆ deserializer_used_size()

size_t eprosima::safedds::serialization::cdr::Deserializer::deserializer_used_size ( ) const
overridevirtualnoexcept

Gets deserializer used size.

Returns
Used size

Implements eprosima::safedds::serialization::IDeserializer.

◆ is_native_endianess()

bool eprosima::safedds::serialization::cdr::Deserializer::is_native_endianess ( ) const
overridevirtualnoexcept

Checks if deserializer is in native endianness.

Returns
true if native endianness, false otherwise

Implements eprosima::safedds::serialization::IDeserializer.


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