10#ifndef MSGPACK_V1_TYPE_SET_HPP
11#define MSGPACK_V1_TYPE_SET_HPP
28#if !defined(MSGPACK_USE_CPP03)
30template <
typename T,
typename Compare,
typename Alloc>
31struct as<std::set<T, Compare, Alloc>, typename std::enable_if<msgpack::has_as<T>::value>::type> {
36 std::set<T, Compare, Alloc> v;
47template <
typename T,
typename Compare,
typename Alloc>
48struct convert<std::set<T, Compare, Alloc> > {
53 std::set<T, Compare, Alloc> tmp;
56 tmp.insert(p->
as<T>());
58#if MSGPACK_CPP_VERSION >= 201103L
67template <
typename T,
typename Compare,
typename Alloc>
68struct pack<std::set<T, Compare, Alloc> > {
69 template <
typename Stream>
73 for (
typename std::set<T, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
81template <
typename T,
typename Compare,
typename Alloc>
84 o.
type = msgpack::type::ARRAY;
95 typename std::set<T, Compare, Alloc>::const_iterator it(v.begin());
105#if !defined(MSGPACK_USE_CPP03)
107template <
typename T,
typename Compare,
typename Alloc>
108struct as<std::multiset<T, Compare, Alloc>, typename std::enable_if<msgpack::has_as<T>::value>::type> {
113 std::multiset<T, Compare, Alloc> v;
116 v.insert(p->
as<T>());
124template <
typename T,
typename Compare,
typename Alloc>
125struct convert<std::multiset<T, Compare, Alloc> > {
130 std::multiset<T, Compare, Alloc> tmp;
133 tmp.insert(p->
as<T>());
135#if MSGPACK_CPP_VERSION >= 201103L
144template <
typename T,
typename Compare,
typename Alloc>
145struct pack<std::multiset<T, Compare, Alloc> > {
146 template <
typename Stream>
150 for (
typename std::multiset<T, Compare, Alloc>::const_iterator it(v.begin()), it_end(v.end());
151 it != it_end; ++it) {
158template <
typename T,
typename Compare,
typename Alloc>
161 o.
type = msgpack::type::ARRAY;
171 typename std::multiset<T, Compare, Alloc>::const_iterator it(v.begin());
The class template that supports continuous packing.
Definition pack.hpp:33
packer< Stream > & pack_array(uint32_t n)
Packing array header and size.
Definition pack.hpp:1195
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::multiset< T, Compare, Alloc > operator()(msgpack::object const &o) const
Definition set.hpp:109
std::set< T, Compare, Alloc > operator()(msgpack::object const &o) const
Definition set.hpp:32
Definition object_fwd_decl.hpp:61
msgpack::object const & operator()(msgpack::object const &o, std::multiset< T, Compare, Alloc > &v) const
Definition set.hpp:126
msgpack::object const & operator()(msgpack::object const &o, std::set< T, Compare, Alloc > &v) const
Definition set.hpp:49
Definition adaptor_base.hpp:27
void operator()(msgpack::object::with_zone &o, const std::multiset< T, Compare, Alloc > &v) const
Definition set.hpp:160
void operator()(msgpack::object::with_zone &o, const std::set< T, Compare, Alloc > &v) const
Definition set.hpp:83
Definition adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::multiset< T, Compare, Alloc > &v) const
Definition set.hpp:147
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::set< T, Compare, Alloc > &v) const
Definition set.hpp:70
Definition adaptor_base.hpp:32
msgpack::zone & zone
Definition object.hpp:37
uint32_t size
Definition object_fwd.hpp:23
msgpack::object * ptr
Definition object_fwd.hpp:24
Object class that corresponding to MessagePack format object.
Definition object_fwd.hpp:75
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_array array
Definition object_fwd.hpp:85
#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