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>
30 std::unordered_map<K, V, Hash, Compare, 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;
37 for (; p != pend; ++p) {
44template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
45struct convert<std::unordered_map<K, V, Hash, Compare, Alloc>> {
50 std::unordered_map<K, V, Hash, Compare, Alloc> tmp;
51 for(; p != pend; ++p) {
61template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
62struct pack<std::unordered_map<K, V, Hash, Compare, 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;
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>
103 std::unordered_multimap<K, V, Hash, Compare, 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;
110 for (; p != pend; ++p) {
117template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
118struct convert<std::unordered_multimap<K, V, Hash, Compare, Alloc>> {
123 std::unordered_multimap<K, V, Hash, Compare, Alloc> tmp;
124 for(; p != pend; ++p) {
125 std::pair<K, V> value;
128 tmp.insert(std::move(value));
135template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
136struct pack<std::unordered_multimap<K, V, Hash, Compare, 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());
142 it != it_end; ++it) {
150template <
typename K,
typename V,
typename Hash,
typename Compare,
typename Alloc>
153 o.
type = msgpack::type::MAP;
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
packer< Stream > & pack_map(uint32_t n)
Packing map header and size.
Definition pack.hpp:1213
packer< Stream > & pack(const T &v)
Packing function template.
Definition object_fwd.hpp:231
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition cpp03_zone.hpp:255
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
msgpack::zone & zone
Definition object.hpp:37
msgpack::object val
Definition object.hpp:32
msgpack::object key
Definition object.hpp:31
uint32_t size
Definition object_fwd.hpp:28
msgpack::object_kv * ptr
Definition object_fwd.hpp:29
Object class that corresponding to MessagePack format object.
Definition object_fwd.hpp:75
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:1076
std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition object.hpp:1126
union_type via
Definition object_fwd.hpp:93
msgpack::type::object_type type
Definition object_fwd.hpp:92
msgpack::object_map map
Definition object_fwd.hpp:86
#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