1 #ifndef PROTON_SCALAR_HPP 2 #define PROTON_SCALAR_HPP 23 #include "./scalar_base.hpp" 25 #include <proton/type_compat.h> 38 template <
class T>
scalar(
const T& x) { *
this = x; }
44 void clear() { *
this = null(); }
55 template<
class T> T
get(
const scalar& s) {
return internal::get<T>(s); }
67 template<
class T> T
coerce(
const scalar& x) {
return internal::coerce<T>(x); }
80 template<
class T> T
coerce(
scalar& x) {
return internal::coerce<T>(x); }
84 #endif // PROTON_SCALAR_HPP A holder for an instance of any scalar AMQP type.
Definition: scalar.hpp:32
T coerce(const scalar &x)
Coerce the contained value to type T.
Definition: scalar.hpp:67
T coerce(scalar &x)
Coerce the contained value to type T.
Definition: scalar.hpp:80
Base class for scalar types.
Definition: scalar_base.hpp:57
scalar & operator=(const T &x)
Assign from any scalar type.
Definition: scalar.hpp:41
void clear()
Clear the scalar, making it empty().
Definition: scalar.hpp:44
scalar(const T &x)
Construct from any scalar type.
Definition: scalar.hpp:38
scalar()
Create an empty scalar.
Definition: scalar.hpp:35
The main Proton namespace.
Definition: annotation_key.hpp:30