Helper class to decode msgpack binary into a vector.
More...
#include <binary_decoder.hpp>
|
| BinaryDecoder (const msgpack::object &obj, const std::string &key="UNNAMED_BINARY") |
| Initialize object given a msgpack object. Reads out binary header to prepare for call of decode. More...
|
|
template<typename T > |
void | decode (T &target) |
| Decode binary msgpack object into the given target. More...
|
|
template<> |
void | decode (std::vector< float > &output) |
|
template<> |
void | decode (std::vector< int8_t > &output) |
|
template<> |
void | decode (std::vector< int16_t > &output) |
|
template<> |
void | decode (std::vector< int32_t > &output) |
|
template<> |
void | decode (std::vector< std::string > &output) |
|
template<> |
void | decode (std::vector< char > &output) |
|
Helper class to decode msgpack binary into a vector.
◆ BinaryDecoder()
mmtf::BinaryDecoder::BinaryDecoder |
( |
const msgpack::object & |
obj, |
|
|
const std::string & |
key = "UNNAMED_BINARY" |
|
) |
| |
|
inline |
Initialize object given a msgpack object. Reads out binary header to prepare for call of decode.
- Parameters
-
[in] | obj | Object to decode. |
[in] | key | Key used to report errors. |
- Exceptions
-
◆ decode() [1/7]
template<>
void mmtf::BinaryDecoder::decode |
( |
std::vector< char > & |
output | ) |
|
|
inline |
◆ decode() [2/7]
template<>
void mmtf::BinaryDecoder::decode |
( |
std::vector< float > & |
output | ) |
|
|
inline |
◆ decode() [3/7]
template<>
void mmtf::BinaryDecoder::decode |
( |
std::vector< int16_t > & |
output | ) |
|
|
inline |
◆ decode() [4/7]
template<>
void mmtf::BinaryDecoder::decode |
( |
std::vector< int32_t > & |
output | ) |
|
|
inline |
◆ decode() [5/7]
template<>
void mmtf::BinaryDecoder::decode |
( |
std::vector< int8_t > & |
output | ) |
|
|
inline |
◆ decode() [6/7]
template<>
void mmtf::BinaryDecoder::decode |
( |
std::vector< std::string > & |
output | ) |
|
|
inline |
◆ decode() [7/7]
template<typename T >
void mmtf::BinaryDecoder::decode |
( |
T & |
target | ) |
|
Decode binary msgpack object into the given target.
- Parameters
-
[out] | target | Store decoded vector into this field. |
- Template Parameters
-
T | Can be one of:
- std::vector<float> (strategies: 1, 9, 10, 11, 12, 13)
- std::vector<int8_t> (strategies: 2)
- std::vector<int16_t> (strategies: 3)
- std::vector<int32_t> (strategies: 4, 7, 8, 14, 15)
- std::vector<std::string> (strategies: 5)
- std::vector<char> (strategies: 6)
|
- Exceptions
-
The documentation for this class was generated from the following file: