Qpid Proton C++ API
0.32.0
|
|
Go to the documentation of this file.
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> {};
82 #if PN_CPP_HAS_RVALUE_REFERENCES
94 typename assignable_map<M, map&>::type
operator=(
const M& x) {
value(x);
return *
this; }
110 PN_CPP_EXTERN T
get(
const K& k)
const;
113 PN_CPP_EXTERN
void put(
const K& k,
const T& v);
116 PN_CPP_EXTERN
size_t erase(
const K& k);
119 PN_CPP_EXTERN
bool exists(
const K& k)
const;
122 PN_CPP_EXTERN
size_t size()
const;
131 explicit map(pn_data_t*);
132 void reset(pn_data_t*);
136 typedef map_type_impl<K,T> map_type;
137 mutable internal::pn_unique_ptr<map_type> map_;
140 map_type& cache()
const;
146 friend PN_CPP_EXTERN
void swap<>(
map&,
map&);
152 #endif // PROTON_MAP_HPP
map(const map &)
Copy a map.
A holder for any AMQP value, simple or complex.
Definition: value.hpp:57
void value(const value &x)
Copy from a proton::value.
map()
Construct an empty map.
std::ostream & operator<<(std::ostream &, const binary &)
Print a binary value.
T get(const K &k) const
Get the map entry for key k.
void clear()
Remove all map entries.
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.
const proton::value & value() const
Access as a proton::value containing an AMQP map.
A collection of key-value pairs.
Definition: map.hpp:67
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:94
map & operator=(map &&)
Move a map.
A holder for any AMQP value, simple or complex.
Unsettled API - A stream-like decoder from AMQP bytes to C++ values.
Definition: decoder.hpp:56
map & operator=(const map &)
Copy a map.
void put(const K &k, const T &v)
Put a map entry for key k.
Unsettled API - A stream-like encoder from C++ values to AMQP bytes.
Definition: encoder.hpp:50
bool empty() const
True if the map has no entries.
The main Proton namespace.
Definition: annotation_key.hpp:33
size_t erase(const K &k)
Erase the map entry at k.
proton::value & value()
Access as a proton::value containing an AMQP map.
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.