10 #ifndef MSGPACK_V1_TYPE_CPP11_UNORDERED_SET_HPP 11 #define MSGPACK_V1_TYPE_CPP11_UNORDERED_SET_HPP 17 #include <unordered_set> 27 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
28 struct as<std::unordered_set<Key, Hash, Compare, Alloc>, typename std::enable_if<msgpack::has_as<Key>::value>::type> {
33 std::unordered_set<Key, Hash, Compare, Alloc> v;
36 v.insert(p->
as<Key>());
42 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
43 struct convert<std::unordered_set<Key, Hash, Compare, Alloc>> {
48 std::unordered_set<Key, Hash, Compare, Alloc> tmp;
51 tmp.insert(p->
as<Key>());
58 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
59 struct pack<std::unordered_set<Key, Hash, Compare, Alloc>> {
60 template <
typename Stream>
64 for(
typename std::unordered_set<Key, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
72 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
85 typename std::unordered_set<Key, Hash, Compare, Alloc>::const_iterator it(v.begin());
96 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
97 struct as<std::unordered_multiset<Key, Hash, Compare, Alloc>, typename std::enable_if<msgpack::has_as<Key>::value>::type> {
102 std::unordered_multiset<Key, Hash, Compare, Alloc> v;
105 v.insert(p->
as<Key>());
111 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
112 struct convert<std::unordered_multiset<Key, Hash, Compare, Alloc>> {
117 std::unordered_multiset<Key, Hash, Compare, Alloc> tmp;
120 tmp.insert(p->
as<Key>());
127 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
128 struct pack<std::unordered_multiset<Key, Hash, Compare, Alloc>> {
129 template <
typename Stream>
133 for(
typename std::unordered_multiset<Key, Hash, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
134 it != it_end; ++it) {
141 template <
typename Key,
typename Hash,
typename Compare,
typename Alloc>
154 typename std::unordered_multiset<Key, Hash, Compare, Alloc>::const_iterator it(v.begin());
172 #endif // MSGPACK_V1_TYPE_CPP11_UNORDERED_SET_HPP std::unordered_multiset< Key, Hash, Compare, Alloc > operator()(msgpack::object const &o) const
Definition: unordered_set.hpp:98
uint32_t size
Definition: object_fwd.hpp:23
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition: cpp03_zone.hpp:246
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
msgpack::object * ptr
Definition: object_fwd.hpp:24
packer< Stream > & pack_array(uint32_t n)
Packing array header and size.
Definition: pack.hpp:1160
Definition: adaptor_base.hpp:15
Definition: object.hpp:35
packer< Stream > & pack(const T &v)
Packing function template.
Definition: adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::unordered_set< Key, Hash, Compare, Alloc > &v) const
Definition: unordered_set.hpp:61
Definition: object_fwd.hpp:236
Definition: adaptor_base.hpp:32
std::size_t size(T const &t)
Definition: size_equal_only.hpp:24
void operator()(msgpack::object::with_zone &o, const std::unordered_multiset< Key, Hash, Compare, Alloc > &v) const
Definition: unordered_set.hpp:143
msgpack::object_array array
Definition: object_fwd.hpp:85
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
msgpack::object const & operator()(msgpack::object const &o, std::unordered_multiset< Key, Hash, Compare, Alloc > &v) const
Definition: unordered_set.hpp:113
msgpack::object const & operator()(msgpack::object const &o, std::unordered_set< Key, Hash, Compare, Alloc > &v) const
Definition: unordered_set.hpp:44
msgpack::type::object_type type
Definition: object_fwd.hpp:92
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
Definition: object_fwd_decl.hpp:41
#define MSGPACK_ZONE_ALIGNOF(type)
Definition: cpp03_zone_decl.hpp:30
The class template that supports continuous packing.
Definition: adaptor_base_decl.hpp:24
#define MSGPACK_NULLPTR
Definition: cpp_config_decl.hpp:35
msgpack::zone & zone
Definition: object.hpp:37
Definition: adaptor_base.hpp:27
void operator()(msgpack::object::with_zone &o, const std::unordered_set< Key, Hash, Compare, Alloc > &v) const
Definition: unordered_set.hpp:74
std::unordered_set< Key, Hash, Compare, Alloc > operator()(msgpack::object const &o) const
Definition: unordered_set.hpp:29
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::unordered_multiset< Key, Hash, Compare, Alloc > &v) const
Definition: unordered_set.hpp:130