Loading...
Searching...
No Matches
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.
map & | operator= (const map &)
| Copy a map.
| map (const std::map< K, T > &)
| Copy a std::map.
map & | operator= (const std::map< K, T > &)
| Copy a std::map.
| map (const std::initializer_list< std::pair< const K, T > > &)
| Initializer_list constructor.
| map (map &&)
| Move a map.
map & | operator= (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>.
void | value (const value &x)
| Copy from a proton::value.
proton::value & | value ()
| Access as a proton::value containing an AMQP map.
const proton::value & | value () const
| Access as a proton::value containing an AMQP map.
T | get (const K &k) const
| Get the map entry for key k.
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=()

template<class K, class T>
template<class M>

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()

template<class K, class T>

void value | ( | const value & | x | ) |

Copy from a proton::value.

Exceptions

  proton::conversion_error | if x does not contain a compatible map.

## get()

template<class K, class T>

T get | ( | const K & | k | ) | const

Get the map entry for key k.

Return T() if there is no such entry.

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

- proton/map.hpp