message_id

An AMQP message ID. More...

`#include <message_id.hpp>`

Inherits scalar_base.

## Public Member Functions

| message_id ()
| An empty message_id has a uint64_t value set to 0.
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_id & | operator= (uint64_t x)
message_id & | operator= (const uuid &x)
message_id & | operator= (const binary &x)
message_id & | operator= (const std::string &x)
message_id & | operator= (const char *x)
| Treated as amqp::STRING.

## 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. More...
template<>
uuid | get (const message_id &x)
| Get the uuid value or throw conversion_error. More...
template<>
binary | get (const message_id &x)
| Get the binary value or throw conversion_error. More...
template<>
std::string | get (const message_id &x)
| Get the std::string value or throw conversion_error. More...
template<class T >
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:

- uint64_t
- std::string
- proton::uuid
- proton::binary

## 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 = 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 `std::is_convertible`

## get() [1/4]

uint64_t get< uint64_t > | ( | const message_id & | x | ) |

related

Get the uint64_t value or throw conversion_error.

## get() [2/4]

uuid get< uuid > | ( | const message_id & | x | ) |

related

Get the uuid value or throw conversion_error.

## get() [3/4]

binary get< binary > | ( | const message_id & | x | ) |

related

Get the binary value or throw conversion_error.

## get() [4/4]

std::string get< std::string > | ( | const message_id & | x | ) |

related

Get the std::string value or throw conversion_error.

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

- proton/message_id.hpp