Qpid Proton C++  0.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Friends | List of all members
scalar Class Reference

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.
 
scalaroperator= (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 >
get () const
 get<T>() is like get(T&) but returns the value.
 
Assignment operators

Assign a C++ value and deduce the AMQP type().

scalaroperator= (bool)
 
scalaroperator= (uint8_t)
 
scalaroperator= (int8_t)
 
scalaroperator= (uint16_t)
 
scalaroperator= (int16_t)
 
scalaroperator= (uint32_t)
 
scalaroperator= (int32_t)
 
scalaroperator= (uint64_t)
 
scalaroperator= (int64_t)
 
scalaroperator= (wchar_t)
 
scalaroperator= (float)
 
scalaroperator= (double)
 
scalaroperator= (amqp_timestamp)
 
scalaroperator= (const amqp_decimal32 &)
 
scalaroperator= (const amqp_decimal64 &)
 
scalaroperator= (const amqp_decimal128 &)
 
scalaroperator= (const amqp_uuid &)
 
scalaroperator= (const amqp_string &)
 
scalaroperator= (const amqp_symbol &)
 
scalaroperator= (const amqp_binary &)
 
scalaroperator= (const std::string &s)
 Treated as an AMQP string.
 
scalaroperator= (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
 

Detailed Description

A holder for an instance of any scalar AMQP type.


The documentation for this class was generated from the following file: