Unsettled API - A stream-like decoder from AMQP bytes to C++ values. More...
#include <decoder.hpp>
Inherits data.
Public Member Functions | |||
decoder (const data &d, bool exact=false) | |||
Wrap a Proton C data object. More... | |||
decoder (const internal::value_base &, bool exact=false) | |||
Attach decoder to a proton::value. More... | |||
void | decode (const char *buffer, size_t size) | ||
Decode AMQP data from a buffer and add it to the end of the decoders stream. | |||
void | decode (const std::string &) | ||
Decode AMQP data from a std::string and add it to the end of the decoders stream. | |||
bool | more () | ||
Return true if there are more value to extract at the current level. | |||
type_id | next_type () | ||
Get the type of the next value that will be read by operator>>. More... | |||
decoder & | operator>> (start &) | ||
Start decoding a container type, such as an ARRAY, LIST or MAP. More... | |||
decoder & | operator>> (const finish &) | ||
Finish decoding a container type, and move on to the next value in the stream. | |||
template<class T > | |||
decoder & | operator>> (sequence_ref< T > r) | ||
Extract any AMQP sequence (ARRAY, LIST or MAP) to a C++ sequence container of T if the elements types are convertible to T. More... | |||
template<class T > | |||
decoder & | operator>> (associative_ref< T > r) | ||
Extract an AMQP MAP to a C++ associative container. | |||
template<class T > | |||
decoder & | operator>> (pair_sequence_ref< T > r) | ||
Extract an AMQP MAP to a C++ push_back sequence of pairs preserving encoded order. | |||
Extract built-in types | |||
| |||
decoder & | operator>> (bool &) | ||
decoder & | operator>> (uint8_t &) | ||
decoder & | operator>> (int8_t &) | ||
decoder & | operator>> (uint16_t &) | ||
decoder & | operator>> (int16_t &) | ||
decoder & | operator>> (uint32_t &) | ||
decoder & | operator>> (int32_t &) | ||
decoder & | operator>> (wchar_t &) | ||
decoder & | operator>> (uint64_t &) | ||
decoder & | operator>> (int64_t &) | ||
decoder & | operator>> (timestamp &) | ||
decoder & | operator>> (float &) | ||
decoder & | operator>> (double &) | ||
decoder & | operator>> (decimal32 &) | ||
decoder & | operator>> (decimal64 &) | ||
decoder & | operator>> (decimal128 &) | ||
decoder & | operator>> (uuid &) | ||
decoder & | operator>> (std::string &) | ||
decoder & | operator>> (symbol &) | ||
decoder & | operator>> (binary &) | ||
decoder & | operator>> (message_id &) | ||
decoder & | operator>> (annotation_key &) | ||
decoder & | operator>> (scalar &) | ||
decoder & | operator>> (internal::value_base &) | ||
decoder & | operator>> (null &) | ||
decoder & | operator>> (decltype(nullptr)&) | ||
Friends | |
class | message |
Unsettled API - A stream-like decoder from AMQP bytes to C++ values.
For internal use only.
|
inlineexplicit |
Wrap a Proton C data object.
The exact flag if set means decode only when there is an exact match between the AMQP and C++ type. If not set then perform automatic conversions.
|
explicit |
Attach decoder to a proton::value.
The decoder is rewound to the start of the data.
type_id next_type | ( | ) |
Get the type of the next value that will be read by operator>>.
conversion_error | if no more values. |
Start decoding a container type, such as an ARRAY, LIST or MAP.
This "enters" the container, more() will return false at the end of the container. Call finish() to "exit" the container and move on to the next value.
|
inline |
Extract any AMQP sequence (ARRAY, LIST or MAP) to a C++ sequence container of T if the elements types are convertible to T.
A MAP is extracted as [key1, value1, key2, value2...]
.