Qpid Proton C++ API  0.37.0
message_id

An AMQP message ID. More...

#include <message_id.hpp>

Inheritance diagram for message_id:
scalar_base

Public Member Functions

 message_id ()=default
 An empty message_id.
 
template<class T >
 message_id (const T &x)
 Construct from any type that can be assigned.
 
Assignment operators

Assign a C++ value, deduce the AMQP type()

message_idoperator= (uint64_t x)
 
message_idoperator= (const uuid &x)
 
message_idoperator= (const binary &x)
 
message_idoperator= (const std::string &x)
 
message_idoperator= (const char *x)
 Treated as amqp::STRING.
 
- Public Member Functions inherited from scalar_base
type_id type () const
 AMQP type of data stored in the scalar.
 
bool empty () const
 True if there is no value, i.e. type() == NULL_TYPE.
 

Related Functions

(Note that these are not member functions.)

template<>
uint64_t get (const message_id &x)
 Get the uint64_t value or throw conversion_error.
 
template<>
uuid get (const message_id &x)
 Get the uuid value or throw conversion_error.
 
template<>
binary get (const message_id &x)
 Get the binary value or throw conversion_error.
 
template<>
std::string get (const message_id &x)
 Get the std::string value or throw conversion_error.
 
template<class T >
coerce (const message_id &x)
 Coerce the contained value to type T. More...
 

Detailed Description

An AMQP message ID.

It can contain one of the following types:

Friends And Related Function Documentation

◆ coerce()

T coerce ( const message_id x)
related

Coerce the contained value to type T.

For example:

 uint64_t i = coerce<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_errorif the value cannot be converted to T according to std::is_convertible

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