10#ifndef MSGPACK_V1_TYPE_CPP11_UNORDERED_MAP_HPP
11#define MSGPACK_V1_TYPE_CPP11_UNORDERED_MAP_HPP
18#include <unordered_map>
28template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
31 typename std::enable_if<msgpack::has_as<K>::value || msgpack::has_as<V>::value>::type> {
36 std::unordered_map<K, V, Hash, Compare, Alloc>
v;
38 v.emplace(
p->key.as<
K>(),
p->val.as<
V>());
44template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
50 std::unordered_map<K, V, Hash, Compare, Alloc>
tmp;
54 p->val.convert(
tmp[std::move(key)]);
61template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
63 template <
typename Stream>
67 for(
typename std::unordered_map<K, V, Hash, Compare, Alloc>::const_iterator
it(
v.begin()),
it_end(
v.end());
76template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
79 o.type = msgpack::type::MAP;
88 o.via.map.size = size;
89 typename std::unordered_map<K, V, Hash, Compare, Alloc>::const_iterator
it(
v.begin());
101template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
104 typename std::enable_if<msgpack::has_as<K>::value || msgpack::has_as<V>::value>::type> {
109 std::unordered_multimap<K, V, Hash, Compare, Alloc>
v;
111 v.emplace(
p->key.as<
K>(),
p->val.as<
V>());
117template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
123 std::unordered_multimap<K, V, Hash, Compare, Alloc>
tmp;
125 std::pair<K, V> value;
126 p->key.convert(value.first);
127 p->val.convert(value.second);
128 tmp.insert(std::move(value));
135template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
137 template <
typename Stream>
141 for(
typename std::unordered_multimap<K, V, Hash, Compare, Alloc>::const_iterator
it(
v.begin()),
it_end(
v.end());
150template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
153 o.type = msgpack::type::MAP;
162 o.via.map.size = size;
163 typename std::unordered_multimap<K, V, Hash, Compare, Alloc>::const_iterator
it(
v.begin());
The class template that supports continuous packing.
Definition pack.hpp:33
Definition object_fwd.hpp:231
Definition adaptor_base.hpp:15
uint32_t checked_get_container_size(T size)
Definition check_container_size.hpp:55
std::unordered_map< K, V, Hash, Compare, Alloc > operator()(msgpack::object const &o) const
Definition unordered_map.hpp:32
std::unordered_multimap< K, V, Hash, Compare, Alloc > operator()(msgpack::object const &o) const
Definition unordered_map.hpp:105
Definition object_fwd_decl.hpp:61
msgpack::object const & operator()(msgpack::object const &o, std::unordered_map< K, V, Hash, Compare, Alloc > &v) const
Definition unordered_map.hpp:46
msgpack::object const & operator()(msgpack::object const &o, std::unordered_multimap< K, V, Hash, Compare, Alloc > &v) const
Definition unordered_map.hpp:119
Definition adaptor_base.hpp:27
void operator()(msgpack::object::with_zone &o, const std::unordered_map< K, V, Hash, Compare, Alloc > &v) const
Definition unordered_map.hpp:78
void operator()(msgpack::object::with_zone &o, const std::unordered_multimap< K, V, Hash, Compare, Alloc > &v) const
Definition unordered_map.hpp:152
Definition adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::unordered_map< K, V, Hash, Compare, Alloc > &v) const
Definition unordered_map.hpp:64
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::unordered_multimap< K, V, Hash, Compare, Alloc > &v) const
Definition unordered_map.hpp:138
Definition adaptor_base.hpp:32
Object class that corresponding to MessagePack format object.
Definition object_fwd.hpp:75
#define MSGPACK_NULLPTR
Definition cpp_config_decl.hpp:85
#define MSGPACK_ZONE_ALIGNOF(type)
Definition cpp03_zone_decl.hpp:30
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition versioning.hpp:66