Qpid Proton C++ API  0.18.0
proton Namespace Reference

The main Proton namespace. More...

Namespaces

 codec
 Unsettled API - AMQP data encoding and decoding.
 
 io
 Unsettled API - Interfaces for IO integration.
 

Classes

class  annotation_key
 A key for use with AMQP annotation maps. More...
 
class  binary
 Arbitrary binary data. More...
 
class  byte_array
 Arbitrary fixed-size data. More...
 
class  connection
 A connection to a remote AMQP peer. More...
 
class  connection_options
 Options for creating a connection. More...
 
class  container
 A top-level container of connections, sessions, and links. More...
 
struct  conversion_error
 An error converting between AMQP and C++ data. More...
 
class  decimal128
 A 128-bit decimal floating-point value. More...
 
class  decimal32
 A 32-bit decimal floating-point value. More...
 
class  decimal64
 A 64-bit decimal floating-point value. More...
 
class  delivery
 A received message. More...
 
struct  delivery_mode
 The message delivery policy to establish when opening a link. More...
 
class  duration
 A span of time in milliseconds. More...
 
class  endpoint
 The base class for session, connection, and link. More...
 
struct  error
 The base Proton error. More...
 
class  error_condition
 Describes an endpoint error state. More...
 
class  link
 A named channel for sending or receiving messages. More...
 
class  listen_handler
 Unsettled API - A handler for incoming connections. More...
 
class  listener
 A listener for incoming connections. More...
 
class  map
 A collection of key-value pairs. More...
 
class  message
 An AMQP message. More...
 
class  message_id
 An AMQP message ID. More...
 
class  messaging_handler
 A handler for Proton messaging events. More...
 
class  receiver
 A channel for receiving messages. More...
 
class  receiver_options
 Options for creating a receiver. More...
 
class  reconnect_options
 Unsettled API - Options for reconnect and failover after connection loss. More...
 
class  returned
 A return type for container methods. More...
 
class  sasl
 SASL information. More...
 
class  scalar
 A holder for an instance of any scalar AMQP type. More...
 
class  scalar_base
 The base class for scalar types. More...
 
class  sender
 A channel for sending messages. More...
 
class  sender_options
 Options for creating a sender. More...
 
class  session
 A container of senders and receivers. More...
 
class  session_options
 Options for creating a session. More...
 
class  source
 A point of origin for messages. More...
 
class  source_options
 Options for creating a source node for a sender or receiver. More...
 
class  ssl
 SSL information. More...
 
class  ssl_certificate
 Unsettled API - An SSL certificate. More...
 
class  ssl_client_options
 Unsettled API - SSL configuration for outbound connections. More...
 
class  ssl_server_options
 Unsettled API - SSL configuration for inbound connections. More...
 
class  symbol
 A string that represents the AMQP symbol type. More...
 
class  target
 A destination for messages. More...
 
class  target_options
 Options for creating a target node for a sender or receiver. More...
 
class  terminus
 One end of a link, either a source or a target. More...
 
struct  timeout_error
 An operation timed out. More...
 
class  timestamp
 A 64-bit timestamp in milliseconds since the Unix epoch. More...
 
class  tracker
 A tracker for a sent message. More...
 
class  transfer
 The base class for delivery and tracker. More...
 
class  transport
 A network channel supporting an AMQP connection. More...
 
class  url
 Deprecated - Use a third-party URL library. More...
 
struct  url_error
 Deprecated - Use a third-party URL library. More...
 
class  uuid
 A 16-byte universally unique identifier. More...
 
class  value
 A holder for any AMQP value, simple or complex. More...
 
class  work_queue
 Unsettled API - A context for thread-safe execution of work. More...
 

Typedefs

typedef class container default_container
 Deprecated - Use proton::container.
 

Enumerations

enum  type_id {
  NULL_TYPE, BOOLEAN, UBYTE, BYTE,
  USHORT, SHORT, UINT, INT,
  CHAR, ULONG, LONG, TIMESTAMP,
  FLOAT, DOUBLE, DECIMAL32, DECIMAL64,
  DECIMAL128, UUID, BINARY, STRING,
  SYMBOL, DESCRIBED, ARRAY, LIST,
  MAP
}
 An identifier for AMQP types. More...
 

Functions

template<>
uint64_t get< uint64_t > (const annotation_key &x)
 Get the uint64_t value or throw conversion_error.
 
template<>
symbol get< symbol > (const annotation_key &x)
 Get the symbol value or throw conversion_error.
 
template<class T >
coerce (const annotation_key &x)
 Get the binary value or throw conversion_error. More...
 
std::ostream & operator<< (std::ostream &, const binary &)
 Print a binary value.
 
std::ostream & operator<< (std::ostream &, const decimal32 &)
 Print a 32-bit decimal value.
 
std::ostream & operator<< (std::ostream &, const decimal64 &)
 Print a 64-bit decimal value.
 
std::ostream & operator<< (std::ostream &, const decimal128 &)
 Print a 128-bit decimal value.
 
std::ostream & operator<< (std::ostream &, duration)
 Print a duration.
 
template<class K , class T >
proton::codec::decoderoperator>> (proton::codec::decoder &d, map< K, T > &m)
 Decode from a proton::map.
 
template<class K , class T >
proton::codec::encoderoperator<< (proton::codec::encoder &e, const map< K, T > &m)
 Encode to a proton::map.
 
template<class K , class T >
void swap (map< K, T > &, map< K, T > &)
 Swap proton::map instances.
 
template<>
uint64_t get< uint64_t > (const message_id &x)
 Get the uint64_t value or throw conversion_error. More...
 
template<>
uuid get< uuid > (const message_id &x)
 Get the uuid value or throw conversion_error. More...
 
template<>
binary get< binary > (const message_id &x)
 Get the binary value or throw conversion_error. More...
 
template<>
std::string get< std::string > (const message_id &x)
 Get the std::string value or throw conversion_error. More...
 
template<class T >
coerce (const message_id &x)
 Coerce the contained value to type T. More...
 
template<class T >
get (const scalar &s)
 Get a contained value of type T. More...
 
template<class T >
coerce (const scalar &x)
 Coerce the contained value to type T. More...
 
template<class T >
coerce (scalar &x)
 Coerce the contained value to type T. More...
 
std::string to_string (const scalar_base &x)
 Return a readable string representation of x for display purposes.
 
std::ostream & operator<< (std::ostream &, timestamp)
 Print a timestamp.
 
std::string type_name (type_id)
 Get the name of the AMQP type.
 
std::ostream & operator<< (std::ostream &, type_id)
 Print the type name.
 
void assert_type_equal (type_id want, type_id got)
 Throw a conversion_error if want != got with a message including the names of the types. More...
 
std::ostream & operator<< (std::ostream &, const uuid &)
 UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric chars and 4 hypens). More...
 
template<class T >
get (const value &v)
 Get a contained value of type T. More...
 
template<class T >
void get (const value &v, T &x)
 Like get(const value&) but assigns the value to a reference instead of returning it. More...
 
template<class T , class U >
void get (const U &u, T &x)
 
template<class T >
coerce (const value &v)
 Coerce the contained value to type T. More...
 
template<class T >
void coerce (const value &v, T &x)
 Like coerce(const value&) but assigns the value to a reference instead of returning it. More...
 
template<>
void get< null > (const value &v, null &)
 Special case for get<null>(), just checks that value contains NULL.
 
std::string to_string (const value &x)
 Return a readable string representation of x for display purposes.
 
Comparison and arithmetic operators
bool operator< (duration x, duration y)
 
bool operator== (duration x, duration y)
 
duration operator+ (duration x, duration y)
 
duration operator- (duration x, duration y)
 
duration operator* (duration d, uint64_t n)
 
duration operator* (uint64_t n, duration d)
 
bool operator== (timestamp x, timestamp y)
 
bool operator< (timestamp x, timestamp y)
 
timestamp operator+ (timestamp ts, duration d)
 
timestamp operator- (timestamp ts, duration d)
 
duration operator- (timestamp t0, timestamp t1)
 
timestamp operator+ (duration d, timestamp ts)
 
Functions to test the properties of a type ID
bool type_id_is_signed_int (type_id t)
 
bool type_id_is_unsigned_int (type_id t)
 
bool type_id_is_integral (type_id t)
 
bool type_id_is_floating_point (type_id t)
 
bool type_id_is_decimal (type_id t)
 
bool type_id_is_signed (type_id t)
 
bool type_id_is_string_like (type_id t)
 
bool type_id_is_container (type_id t)
 
bool type_id_is_scalar (type_id t)
 
bool type_id_is_null (type_id t)
 

Detailed Description

The main Proton namespace.

Enumeration Type Documentation

◆ type_id

enum type_id

An identifier for AMQP types.

Enumerator
NULL_TYPE 

The null type, contains no data.

BOOLEAN 

Boolean true or false.

UBYTE 

Unsigned 8-bit integer.

BYTE 

Signed 8-bit integer.

USHORT 

Unsigned 16-bit integer.

SHORT 

Signed 16-bit integer.

UINT 

Unsigned 32-bit integer.

INT 

Signed 32-bit integer.

CHAR 

32-bit unicode character.

ULONG 

Unsigned 64-bit integer.

LONG 

Signed 64-bit integer.

TIMESTAMP 

Signed 64-bit milliseconds since the epoch.

FLOAT 

32-bit binary floating point.

DOUBLE 

64-bit binary floating point.

DECIMAL32 

32-bit decimal floating point.

DECIMAL64 

64-bit decimal floating point.

DECIMAL128 

128-bit decimal floating point.

UUID 

16-byte UUID.

BINARY 

Variable-length sequence of bytes.

STRING 

Variable-length utf8-encoded string.

SYMBOL 

Variable-length encoded string.

DESCRIBED 

A descriptor and a value.

ARRAY 

A sequence of values of the same type.

LIST 

A sequence of values of mixed types.

MAP 

A sequence of key-value pairs.

Function Documentation

◆ coerce() [1/6]

T coerce ( const annotation_key x)

Get the binary value or throw conversion_error.

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

◆ get< uint64_t >()

uint64_t get< uint64_t > ( const message_id x)
inline

Get the uint64_t value or throw conversion_error.

◆ get< uuid >()

uuid get< uuid > ( const message_id x)
inline

Get the uuid value or throw conversion_error.

◆ get< binary >()

binary get< binary > ( const message_id x)
inline

Get the binary value or throw conversion_error.

◆ get< std::string >()

std::string get< std::string > ( const message_id x)
inline

Get the std::string value or throw conversion_error.

◆ coerce() [2/6]

T coerce ( const message_id x)

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

◆ get() [1/4]

T get ( const scalar s)

Get a contained value of type T.

For example:

uint64_t i = get<uint64_t>(x)

This will succeed if and only if x contains a uint64_t value.

Exceptions
conversion_errorif contained value is not of type T.
Examples:
message_properties.cpp.

◆ coerce() [3/6]

T coerce ( const scalar x)

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

◆ coerce() [4/6]

T coerce ( scalar x)

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

◆ assert_type_equal()

void proton::assert_type_equal ( type_id  want,
type_id  got 
)

Throw a conversion_error if want != got with a message including the names of the types.

◆ operator<<()

std::ostream& proton::operator<< ( std::ostream &  ,
const uuid  
)

UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric chars and 4 hypens).

◆ get() [2/4]

T get ( const value v)

Get a contained value of type T.

For example:

uint64_t i = get<uint64_t>(x)

This will succeed if and only if x contains a uint64_t value.

Exceptions
conversion_errorif contained value is not of type T.

◆ get() [3/4]

void get ( const value v,
T &  x 
)

Like get(const value&) but assigns the value to a reference instead of returning it.

May be more efficient for complex values (arrays, maps, etc.)

◆ get() [4/4]

void get ( const U &  u,
T &  x 
)
inline

◆ coerce() [5/6]

T coerce ( const value v)

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

◆ coerce() [6/6]

void coerce ( const value v,
T &  x 
)

Like coerce(const value&) but assigns the value to a reference instead of returning it.

May be more efficient for complex values (arrays, maps, etc.)