#include <message_id.hpp>
Public Member Functions | |
message_id () | |
An empty message_id. | |
template<class T > | |
message_id (const T &x) | |
Construct from any type that can be assigned. | |
type_id | type () const |
AMQP type of data stored in the scalar. | |
bool | empty () const |
True if there is no value, i.e. type() == NULL_TYPE. | |
Assignment operators | |
message_id & | operator= (uint64_t x) |
message_id & | operator= (const uuid &x) |
message_id & | operator= (const binary &x) |
message_id & | operator= (const std::string &x) |
message_id & | operator= (const char *x) |
Treated as amqp::STRING. | |
Friends | |
bool | operator< (const scalar_base &x, const scalar_base &y) |
Compare. | |
bool | operator== (const scalar_base &x, const scalar_base &y) |
Compare. | |
std::ostream & | operator<< (std::ostream &o, const scalar_base &x) |
Print the contained value. | |
Related Functions | |
(Note that these are not member functions.) | |
template<> | |
uint64_t | get (const message_id &x) |
template<> | |
uuid | get (const message_id &x) |
Get the uuid value or throw conversion_error. | |
template<> | |
binary | get (const message_id &x) |
Get the binary value or throw conversion_error. | |
template<> | |
std::string | get (const message_id &x) |
Get the std::string value or throw conversion_error. | |
template<class T > | |
T | coerce (const message_id &x) |
An AMQP message ID.
It can contain one of the following types:
uint64_t get< uint64_t > | ( | const message_id & | x | ) | [related] |
Get the uint64_t value or throw conversion_error.
uuid get< uuid > | ( | const message_id & | x | ) | [related] |
Get the uuid value or throw conversion_error.
binary get< binary > | ( | const message_id & | x | ) | [related] |
Get the binary value or throw conversion_error.
std::string get< std::string > | ( | const message_id & | x | ) | [related] |
Get the std::string value or throw conversion_error.
T coerce | ( | const message_id & | x | ) | [related] |
Coerce the contained value to type T. For example:uint64_t i = coerce<uint64_t>(x)This will succeed if x contains any numeric value, but may lose precision if it contains a float or double value.
conversion_error | if the value cannot be converted to T according to `stdis_convertible` |