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

A holder for an AMQP value. More...

#include <value.hpp>

Inherits comparable< value >.

Public Member Functions

 value ()
 Create an empty value.
 
 value (const value &)
 Copy a value.
 
valueoperator= (const value &)
 Copy a value.
 
template<class T >
 value (const T &x)
 Explicit conversion from from C++ type T.
 
 value (const scalar &x)
 Allow implicit conversion from a proton::scalar.
 
template<class T >
valueoperator= (const T &x)
 Create a value from C++ type T.
 
void clear ()
 Remove any contained data.
 
bool empty () const
 True if the value contains no data.
 
type_id type () const
 Get the type of the current value.
 
template<class T >
get () const
 Get the value as C++ type T.
 
Get methods

Extract the value to type T.

template<class T >
void get (T &t) const
 Get the value.
 
template<class T >
void get_map (T &t) const
 Get an AMQP map as any type T that satisfies the map concept.
 
template<class T >
void get_pairs (T &t) const
 Get a map as a as any type T that is a sequence pair-like types with first and second.
 
template<class T >
void get_sequence (T &t) const
 Get an AMQP array or list as type T that satisfies the sequence concept. */.
 
As methods

As methods do "loose" conversion, they will convert the scalar 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())
 

Detailed Description

A holder for an AMQP value.

A proton::value can hold any AMQP data value, simple or compound. It has assignment and conversion operators to convert its contents easily to and from native C++ types.


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