Qpid Proton C++ API  0.34.0
map< K, T >

A collection of key-value pairs. More...

#include <map.hpp>

Public Member Functions

 map ()
 Construct an empty map.
 
 map (const map &)
 Copy a map.
 
mapoperator= (const map &)
 Copy a map.
 
 map (map &&)
 Move a map.
 
mapoperator= (map &&)
 Move a map.
 
template<class M >
assignable_map< M, map & >::type operator= (const M &x)
 Type-safe assign from a compatible map, for instance std::map<K,T>. More...
 
void value (const value &x)
 Copy from a proton::value. More...
 
proton::valuevalue ()
 Access as a proton::value containing an AMQP map.
 
const proton::valuevalue () const
 Access as a proton::value containing an AMQP map.
 
get (const K &k) const
 Get the map entry for key k. More...
 
void put (const K &k, const T &v)
 Put a map entry for key k.
 
size_t erase (const K &k)
 Erase the map entry at k.
 
bool exists (const K &k) const
 True if the map has an entry for k.
 
size_t size () const
 Get the number of map entries.
 
void clear ()
 Remove all map entries.
 
bool empty () const
 True if the map has no entries.
 

Detailed Description

template<class K, class T>
class proton::map< K, T >

A collection of key-value pairs.

Used to access standard AMQP property, annotation, and filter maps attached to proton::message and proton::source.

This class provides only basic get() and put() operations for convenience. For more complicated uses (iteration, preserving order, and so on), convert the value to a standard C++ map type such as std::map. See message_properties.cpp and AMQP and C++ types.

Member Function Documentation

◆ operator=()

assignable_map<M, map&>::type operator= ( const M &  x)
inline

Type-safe assign from a compatible map, for instance std::map<K,T>.

See AMQP and C++ types.

◆ value()

void value ( const value x)

Copy from a proton::value.

Exceptions
proton::conversion_errorif x does not contain a compatible map.

◆ get()

T get ( const K &  k) const

Get the map entry for key k.

Return T() if there is no such entry.

Examples
message_properties.cpp.

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