scalar Class Reference

A holder for an instance of any scalar AMQP type. More...

#include <scalar.hpp>

Inheritance diagram for scalar:

List of all members.

Public Member Functions

 scalar ()
 Create an empty scalar.
template<class T >
 scalar (const T &x)
 Construct from any scalar type.
template<class T >
scalaroperator= (const T &x)
 Assign from any scalar type.
bool empty () const
 True if type() == NULL_TYPE.
void clear ()
 Clear the scalar, making it empty().

Related Functions

(Note that these are not member functions.)



template<class T >
coerce (scalar &x)
 Coerce the contained value to type T.

Detailed Description

A holder for an instance of any scalar AMQP type.

See also:
types_page

Friends And Related Function Documentation

T coerce ( scalar x  )  [related]

Coerce the contained value to type T.

For example:

uint64_t i = get<uint64_t>(x)

This will succeed if x contains any numeric value, but may lose precision if it contains a float or double value.

Exceptions:
conversion_error if the value cannot be converted to T according to `stdis_convertible`

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

Generated on 27 Jan 2017 for Qpid Proton C++ by  doxygen 1.6.1