Dataflow Runtime API
3.1.1.0
|
Deserializes various data types from the given byte buffer. More...
#include <Imt.Base.Core.Serialization/Deserializer.h>
Public Member Functions | |
Deserializer (const uint8_t buffer[], const uint32_t bufferSize) | |
Constructor. More... | |
virtual | ~Deserializer (void) |
Destructor. More... | |
uint32_t | getBufferPos (void) const |
Returns the read position within the byte buffer. More... | |
uint32_t | getBufferSize (void) const |
Returns the size of the byte buffer in bytes. More... | |
const uint8_t * | getBuffer (void) const |
Returns a read-only pointer to the byte buffer. More... | |
uint32_t | getUnusedBufferSize (void) const |
Returns the remaining data to read from the current position until the buffer is empty. More... | |
bool | isReset (void) const |
Returns true if the read position is at the beginning (getBufferPos == 0). More... | |
bool | isFullyDeserialized (void) const |
Returns true if buffer is completely deserialized. More... | |
const uint8_t & | getBufferByte (const uint32_t indexOfByte) const |
Returns the byte of the byte buffer at the given index. More... | |
void | reset (void) |
Resets the Deserializer. More... | |
Deserializer & | operator>> (bool &data) |
Returns a boolean out of the Deserializer. More... | |
Deserializer & | operator>> (uint8_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (char_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (char_t *data) |
Returns a null terminated string out of the Deserializer. More... | |
Deserializer & | operator>> (int8_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (uint16_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (int16_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (uint32_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (int32_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (uint64_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (int64_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (float32_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | operator>> (float64_t &data) |
Returns data out of the Deserializer. More... | |
Deserializer & | popData (void *const pDataDest, const uint32_t bytes) |
Returns multiple data out of Deserializer. More... | |
Deserializer & | operator>> (SerializableIfc &data) |
Returns data out of the Deserializer. More... | |
Deserializes various data types from the given byte buffer.
The read position can be set to the beginning by calling reset. Important: The byte buffer passed with the constructor is not copied and only the pointer to the data is stored.
|
explicit |
Constructor.
buffer[] | Byte buffer array from which data should be read. Must be valid (!= NULL)! |
bufferSize | Size of the byte buffer in number of bytes. |
|
virtual |
Destructor.
const uint8_t* imt::base::core::serialization::Deserializer::getBuffer | ( | void | ) | const |
Returns a read-only pointer to the byte buffer.
const uint8_t& imt::base::core::serialization::Deserializer::getBufferByte | ( | const uint32_t | indexOfByte | ) | const |
Returns the byte of the byte buffer at the given index.
indexOfByte | Byte index. |
uint32_t imt::base::core::serialization::Deserializer::getBufferPos | ( | void | ) | const |
Returns the read position within the byte buffer.
uint32_t imt::base::core::serialization::Deserializer::getBufferSize | ( | void | ) | const |
Returns the size of the byte buffer in bytes.
uint32_t imt::base::core::serialization::Deserializer::getUnusedBufferSize | ( | void | ) | const |
Returns the remaining data to read from the current position until the buffer is empty.
bool imt::base::core::serialization::Deserializer::isFullyDeserialized | ( | void | ) | const |
Returns true if buffer is completely deserialized.
bool imt::base::core::serialization::Deserializer::isReset | ( | void | ) | const |
Returns true if the read position is at the beginning (getBufferPos == 0).
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | bool & | data | ) |
Returns a boolean out of the Deserializer.
data | Holds returned boolean. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | char_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | char_t * | data | ) |
Returns a null terminated string out of the Deserializer.
data | Holds returned string. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | float32_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | float64_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | int16_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | int32_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | int64_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | int8_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | SerializableIfc & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | uint16_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | uint32_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | uint64_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::operator>> | ( | uint8_t & | data | ) |
Returns data out of the Deserializer.
data | Holds returned data. |
Deserializer& imt::base::core::serialization::Deserializer::popData | ( | void *const | pDataDest, |
const uint32_t | bytes | ||
) |
Returns multiple data out of Deserializer.
pDataDest | Holds returned data. |
bytes | Number of bytes to return. |
void imt::base::core::serialization::Deserializer::reset | ( | void | ) |
Resets the Deserializer.