10 #ifndef MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP 11 #define MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP 17 #if defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700) 19 #define MSGPACK_HAS_STD_UNORDERED_MAP 20 #include <unordered_map> 21 #define MSGPACK_STD_TR1 std 23 #else // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700) 27 #define MSGPACK_HAS_STD_TR1_UNORDERED_MAP 29 #include <tr1/unordered_map> 30 #define MSGPACK_STD_TR1 std::tr1 32 #endif // __GNUC__ >= 4 34 #endif // defined(_LIBCPP_VERSION) || (_MSC_VER >= 1700) 36 #if defined(MSGPACK_STD_TR1) 46 template <
typename K,
typename V,
typename Hash,
typename Pred,
typename Alloc>
47 struct convert<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
52 MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> tmp;
53 for(; p != pend; ++p) {
56 p->val.convert(tmp[key]);
63 template <
typename K,
typename V,
typename Hash,
typename Pred,
typename Alloc>
64 struct pack<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
65 template <
typename Stream>
69 for(
typename MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin()), it_end(v.end());
78 template <
typename K,
typename V,
typename Hash,
typename Pred,
typename Alloc>
79 struct object_with_zone<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
91 typename MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin());
102 template <
typename K,
typename V,
typename Hash,
typename Pred,
typename Alloc>
103 struct convert<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
108 MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> tmp;
109 for(; p != pend; ++p) {
110 std::pair<K, V> value;
111 p->key.convert(value.first);
112 p->val.convert(value.second);
120 template <
typename K,
typename V,
typename Hash,
typename Pred,
typename Alloc>
121 struct pack<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
122 template <
typename Stream>
126 for(
typename MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin()), it_end(v.end());
127 it != it_end; ++it) {
135 template <
typename K,
typename V,
typename Hash,
typename Pred,
typename Alloc>
136 struct object_with_zone<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
148 typename MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>::const_iterator it(v.begin());
167 #undef MSGPACK_STD_TR1 169 #endif // MSGPACK_STD_TR1 171 #endif // MSGPACK_TYPE_TR1_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:236
uint32_t checked_get_container_size(T size)
Definition: check_container_size.hpp:55
union_type via
Definition: object_fwd.hpp:92
msgpack::zone & zone
Definition: object.hpp:36
Definition: adaptor_base.hpp:15
void convert(T &v, msgpack::object const &o)
Definition: object.hpp:640
Definition: object.hpp:34
packer< Stream > & pack(const T &v)
Packing function template.
Definition: object.hpp:29
Definition: object_fwd.hpp:222
void pack(msgpack::packer< Stream > &o, const T &v)
Definition: object.hpp:647
packer< Stream > & pack_map(uint32_t n)
Packing map header and size.
Definition: pack.hpp:1178
msgpack::object_map map
Definition: object_fwd.hpp:85
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
msgpack::type::object_type type
Definition: object_fwd.hpp:91
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
uint32_t size
Definition: object_fwd.hpp:28
Definition: object_fwd_decl.hpp:40
The class template that supports continuous packing.
Definition: adaptor_base_decl.hpp:23
msgpack::object const & operator()(msgpack::object const &o, T &v) const
Definition: object.hpp:204