Qpid Proton C++
0.12.0
|
A holder for an instance of any scalar AMQP type. More...
#include <scalar.hpp>
Inherits comparable< scalar >.
Public Member Functions | |
scalar () | |
Create an empty scalar. | |
scalar (const scalar &) | |
Copy a scalar. | |
scalar & | operator= (const scalar &) |
Copy a scalar. | |
type_id | type () const |
Type for the value in the scalar, NULL_TYPE if empty() | |
bool | empty () const |
True if the scalar is empty. | |
template<class T > | |
scalar (T x) | |
Create a scalar from any type that we can assign from. | |
template<class T > | |
T | get () const |
get<T>() is like get(T&) but returns the value. | |
Assignment operators | |
Assign a C++ value and deduce the AMQP type(). | |
scalar & | operator= (bool) |
scalar & | operator= (uint8_t) |
scalar & | operator= (int8_t) |
scalar & | operator= (uint16_t) |
scalar & | operator= (int16_t) |
scalar & | operator= (uint32_t) |
scalar & | operator= (int32_t) |
scalar & | operator= (uint64_t) |
scalar & | operator= (int64_t) |
scalar & | operator= (wchar_t) |
scalar & | operator= (float) |
scalar & | operator= (double) |
scalar & | operator= (amqp_timestamp) |
scalar & | operator= (const amqp_decimal32 &) |
scalar & | operator= (const amqp_decimal64 &) |
scalar & | operator= (const amqp_decimal128 &) |
scalar & | operator= (const amqp_uuid &) |
scalar & | operator= (const amqp_string &) |
scalar & | operator= (const amqp_symbol &) |
scalar & | operator= (const amqp_binary &) |
scalar & | operator= (const std::string &s) |
Treated as an AMQP string. | |
scalar & | operator= (const char *s) |
Treated as an AMQP string. | |
Get methods | |
get(T&) extracts the value if the types match exactly and throws type_error otherwise. | |
void | get (bool &) const |
void | get (uint8_t &) const |
void | get (int8_t &) const |
void | get (uint16_t &) const |
void | get (int16_t &) const |
void | get (uint32_t &) const |
void | get (int32_t &) const |
void | get (uint64_t &) const |
void | get (int64_t &) const |
void | get (wchar_t &) const |
void | get (float &) const |
void | get (double &) const |
void | get (amqp_timestamp &) const |
void | get (amqp_decimal32 &) const |
void | get (amqp_decimal64 &) const |
void | get (amqp_decimal128 &) const |
void | get (amqp_uuid &) const |
void | get (amqp_string &) const |
void | get (amqp_symbol &) const |
void | get (amqp_binary &) const |
void | get (std::string &) const |
Treated as an AMQP string. | |
As methods | |
As methods do "loose" conversion. They will convert the scalar's value to the requested type if possible, else throw type_error. | |
int64_t | as_int () const |
Allowed if type_id_is_integral(type()) | |
uint64_t | as_uint () const |
Allowed if type_id_is_integral(type()) | |
double | as_double () const |
Allowed if type_id_is_floating_point(type()) | |
std::string | as_string () const |
Allowed if type_id_is_string_like(type()) | |
Friends | |
class | message |
A holder for an instance of any scalar AMQP type.