26 #include "./internal/pn_unique_ptr.hpp"
40 template <
class K,
class T>
43 template <
class K,
class T>
47 template <
class K,
class T>
50 template <
class K,
class T>
53 template <
class K,
class T>
66 template <
class K,
class T>
67 class PN_CPP_CLASS_EXTERN
map {
68 template <
class M,
class U=
void>
69 struct assignable_map :
70 public internal::enable_if<codec::is_encodable_map<M,K,T>::value, U> {};
92 typename assignable_map<M, map&>::type
operator=(
const M& x) {
value(x);
return *
this; }
108 PN_CPP_EXTERN T
get(
const K& k)
const;
111 PN_CPP_EXTERN
void put(
const K& k,
const T& v);
114 PN_CPP_EXTERN
size_t erase(
const K& k);
117 PN_CPP_EXTERN
bool exists(
const K& k)
const;
120 PN_CPP_EXTERN
size_t size()
const;
129 explicit map(pn_data_t*);
130 void reset(pn_data_t*);
134 typedef map_type_impl<K,T> map_type;
135 mutable internal::pn_unique_ptr<map_type> map_;
138 map_type& cache()
const;
144 friend PN_CPP_EXTERN
void swap<>(
map&,
map&);
Unsettled API - A stream-like decoder from AMQP bytes to C++ values.
Definition: decoder.hpp:56
Unsettled API - A stream-like encoder from C++ values to AMQP bytes.
Definition: encoder.hpp:50
A collection of key-value pairs.
Definition: map.hpp:67
map & operator=(const map &)
Copy a map.
size_t size() const
Get the number of map entries.
bool empty() const
True if the map has no entries.
const proton::value & value() const
Access as a proton::value containing an AMQP map.
map()
Construct an empty map.
size_t erase(const K &k)
Erase the map entry at k.
T get(const K &k) const
Get the map entry for key k.
map & operator=(map &&)
Move a map.
map(const map &)
Copy a map.
void put(const K &k, const T &v)
Put a map entry for key k.
void clear()
Remove all map entries.
proton::value & value()
Access as a proton::value containing an AMQP map.
void value(const value &x)
Copy from a proton::value.
assignable_map< M, map & >::type operator=(const M &x)
Type-safe assign from a compatible map, for instance std::map<K,T>.
Definition: map.hpp:92
bool exists(const K &k) const
True if the map has an entry for k.
A holder for any AMQP value, simple or complex.
Definition: value.hpp:57
The main Proton namespace.
Definition: annotation_key.hpp:33
proton::codec::decoder & operator>>(proton::codec::decoder &d, map< K, T > &m)
Decode from a proton::map.
void swap(map< K, T > &, map< K, T > &)
Swap proton::map instances.
std::ostream & operator<<(std::ostream &, const binary &)
Print a binary value.
A holder for any AMQP value, simple or complex.