client-cpp
0.10.0
|
#include <AvroByteArrayConverter.hpp>
Public Member Functions | |
AvroByteArrayConverter () | |
T | fromByteArray (const std::uint8_t *data, const std::uint32_t &dataSize) |
void | fromByteArray (const std::uint8_t *data, const std::uint32_t &dataSize, T &datum) |
SharedDataBuffer | toByteArray (const T &datum) |
void | toByteArray (const T &datum, std::vector< std::uint8_t > &dest) |
void | toByteArray (const T &datum, std::ostream &stream) |
void | switchToJson (const avro::ValidSchema &schema) |
void | switchToBinary () |
Used to convert predefined avro objects to/from bytes. NOT Thread safe.
<T> | predefined avro object. |
Definition at line 42 of file AvroByteArrayConverter.hpp.
kaa::AvroByteArrayConverter< T >::AvroByteArrayConverter | ( | ) |
Instantiates a new avro byte array converter based on <T>.
Definition at line 115 of file AvroByteArrayConverter.hpp.
T kaa::AvroByteArrayConverter< T >::fromByteArray | ( | const std::uint8_t * | data, |
const std::uint32_t & | dataSize | ||
) |
Creates avro object from byte array Throws KaaException when invalid data was passed (zero-sized or null buffer)
data | the data |
dataSize | size of data |
Definition at line 121 of file AvroByteArrayConverter.hpp.
void kaa::AvroByteArrayConverter< T >::fromByteArray | ( | const std::uint8_t * | data, |
const std::uint32_t & | dataSize, | ||
T & | datum | ||
) |
Creates avro object from byte array Throws KaaException when invalid data was passed (zero-sized or null buffer)
data | the data |
dataSize | size of data |
the | result of conversion |
Definition at line 137 of file AvroByteArrayConverter.hpp.
|
inline |
Definition at line 104 of file AvroByteArrayConverter.hpp.
|
inline |
Used for debug purpose
Definition at line 99 of file AvroByteArrayConverter.hpp.
SharedDataBuffer kaa::AvroByteArrayConverter< T >::toByteArray | ( | const T & | datum | ) |
Converts object to byte array
datum | the encoding avro object |
Definition at line 150 of file AvroByteArrayConverter.hpp.
void kaa::AvroByteArrayConverter< T >::toByteArray | ( | const T & | datum, |
std::vector< std::uint8_t > & | dest | ||
) |
Converts object to byte array
datum | the encoding avro object |
dest | the buffer that encoded data will be put in |
Definition at line 175 of file AvroByteArrayConverter.hpp.
void kaa::AvroByteArrayConverter< T >::toByteArray | ( | const T & | datum, |
std::ostream & | stream | ||
) |
Converts object to stream
datum | the encoding avro object |
stream | the output stream that encoded data will be put in |
Definition at line 195 of file AvroByteArrayConverter.hpp.