10 #ifndef MSGPACK_V1_TYPE_CPP11_UNORDERED_MAP_HPP 11 #define MSGPACK_V1_TYPE_CPP11_UNORDERED_MAP_HPP 17 #include <unordered_map> 27 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
29 std::unordered_map<K, V, Hash, Compare, Alloc>,
30 typename std::enable_if<msgpack::has_as<K>::value || msgpack::has_as<V>::value>::type> {
35 std::unordered_map<K, V, Hash, Compare, Alloc> v;
36 for (; p != pend; ++p) {
43 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
44 struct convert<std::unordered_map<K, V, Hash, Compare, Alloc>> {
49 std::unordered_map<K, V, Hash, Compare, Alloc> tmp;
50 for(; p != pend; ++p) {
60 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
61 struct pack<std::unordered_map<K, V, Hash, Compare, Alloc>> {
62 template <
typename Stream>
66 for(
typename std::unordered_map<K, V, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
75 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
88 typename std::unordered_map<K, V, Hash, Compare, Alloc>::const_iterator it(v.begin());
100 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
102 std::unordered_multimap<K, V, Hash, Compare, Alloc>,
103 typename std::enable_if<msgpack::has_as<K>::value || msgpack::has_as<V>::value>::type> {
108 std::unordered_multimap<K, V, Hash, Compare, Alloc> v;
109 for (; p != pend; ++p) {
116 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
117 struct convert<std::unordered_multimap<K, V, Hash, Compare, Alloc>> {
122 std::unordered_multimap<K, V, Hash, Compare, Alloc> tmp;
123 for(; p != pend; ++p) {
124 std::pair<K, V> value;
134 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
135 struct pack<std::unordered_multimap<K, V, Hash, Compare, Alloc>> {
136 template <
typename Stream>
140 for(
typename std::unordered_multimap<K, V, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
141 it != it_end; ++it) {
149 template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
162 typename std::unordered_multimap<K, V, Hash, Compare, Alloc>::const_iterator it(v.begin());
182 #endif // MSGPACK_V1_TYPE_CPP11_UNORDERED_MAP_HPP msgpack::object_kv * ptr
Definition: object_fwd.hpp:29
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition: cpp03_zone.hpp:246
std::unordered_multimap< K, V, Hash, Compare, Alloc > operator()(msgpack::object const &o) const
Definition: unordered_map.hpp:104
uint32_t checked_get_container_size(T size)
Definition: check_container_size.hpp:55
Definition: object_fwd_decl.hpp:62
union_type via
Definition: object_fwd.hpp:93
std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition: object.hpp:1121
void operator()(msgpack::object::with_zone &o, const std::unordered_multimap< K, V, Hash, Compare, Alloc > &v) const
Definition: unordered_map.hpp:151
msgpack::object val
Definition: object.hpp:32
Definition: adaptor_base.hpp:15
Definition: object.hpp:35
packer< Stream > & pack(const T &v)
Packing function template.
Definition: object.hpp:30
Definition: adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::unordered_multimap< K, V, Hash, Compare, Alloc > &v) const
Definition: unordered_map.hpp:137
std::unordered_map< K, V, Hash, Compare, Alloc > operator()(msgpack::object const &o) const
Definition: unordered_map.hpp:31
Definition: object_fwd.hpp:236
Definition: adaptor_base.hpp:32
std::size_t size(T const &t)
Definition: size_equal_only.hpp:24
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::unordered_map< K, V, Hash, Compare, Alloc > &v) const
Definition: unordered_map.hpp:63
packer< Stream > & pack_map(uint32_t n)
Packing map header and size.
Definition: pack.hpp:1178
msgpack::object_map map
Definition: object_fwd.hpp:86
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
msgpack::type::object_type type
Definition: object_fwd.hpp:92
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
msgpack::object key
Definition: object.hpp:31
uint32_t size
Definition: object_fwd.hpp:28
Definition: object_fwd_decl.hpp:42
void operator()(msgpack::object::with_zone &o, const std::unordered_map< K, V, Hash, Compare, Alloc > &v) const
Definition: unordered_map.hpp:77
msgpack::object const & operator()(msgpack::object const &o, std::unordered_multimap< K, V, Hash, Compare, Alloc > &v) const
Definition: unordered_map.hpp:118
#define MSGPACK_ZONE_ALIGNOF(type)
Definition: cpp03_zone_decl.hpp:30
msgpack::enable_if< !msgpack::is_array< T >::value &&!msgpack::is_pointer< T >::value, T &>::type convert(T &v) const
Convert the object.
Definition: object.hpp:1071
The class template that supports continuous packing.
Definition: adaptor_base_decl.hpp:24
#define MSGPACK_NULLPTR
Definition: cpp_config_decl.hpp:35
msgpack::object const & operator()(msgpack::object const &o, std::unordered_map< K, V, Hash, Compare, Alloc > &v) const
Definition: unordered_map.hpp:45
msgpack::zone & zone
Definition: object.hpp:37
Definition: adaptor_base.hpp:27