10 #ifndef MSGPACK_V1_CPP11_DEFINE_MAP_HPP
11 #define MSGPACK_V1_CPP11_DEFINE_MAP_HPP
25 template <
typename Tuple, std::
size_t N>
27 template <
typename Packer>
28 static void pack(Packer& pk, Tuple
const& t) {
30 pk.pack(std::get<N-1>(t));
34 std::map<std::string, msgpack::object const*>
const& kvmap) {
36 auto it = kvmap.find(std::get<N-2>(t));
37 if (it != kvmap.end()) {
48 template <
typename Tuple>
50 template <
typename Packer>
51 static void pack(Packer&, Tuple
const&) {}
54 std::map<std::string, msgpack::object const*>
const&) {}
58 template <
typename... Args>
62 template <
typename Packer>
65 static_assert(
sizeof...(Args) % 2 == 0,
"");
66 pk.pack_map(
sizeof...(Args) / 2);
73 std::map<std::string, msgpack::object const*> kvmap;
74 for (uint32_t i = 0; i < o.
via.
map.
size; ++i) {
86 static_assert(
sizeof...(Args) % 2 == 0,
"");
94 std::tuple<Args&...>
a;
98 template <
typename... Args>
Definition: object_fwd.hpp:231
Definition: cpp03_zone.hpp:31
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition: cpp03_zone.hpp:256
std::enable_if< has_as< T >::value >::type convert_helper(msgpack::object const &o, T &t)
Definition: cpp11_convert_helper.hpp:27
@ MAP
Definition: object_fwd_decl.hpp:41
@ STR
Definition: object_fwd_decl.hpp:38
define_map make_define_map()
Definition: cpp03_define_map.hpp:2546
Definition: adaptor_base.hpp:15
void pack(msgpack::packer< Stream > &o, const T &v)
Definition: object.hpp:1180
msgpack::object_handle unpack(const char *data, std::size_t len, std::size_t &off, bool &referenced, unpack_reference_func f, void *user_data, unpack_limit const &limit)
Unpack msgpack::object from a buffer.
Definition: unpack.hpp:1397
Definition: object.hpp:30
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
const char * ptr
Definition: object_fwd.hpp:34
uint32_t size
Definition: object_fwd.hpp:33
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
union_type via
Definition: object_fwd.hpp:93
msgpack::type::object_type type
Definition: object_fwd.hpp:92
static void unpack(msgpack::object const &, Tuple const &, std::map< std::string, msgpack::object const * > const &)
Definition: cpp11_define_map.hpp:52
static void pack(Packer &, Tuple const &)
Definition: cpp11_define_map.hpp:51
static void object(msgpack::object *, msgpack::zone &, Tuple const &)
Definition: cpp11_define_map.hpp:55
Definition: cpp11_define_map.hpp:26
static void unpack(msgpack::object const &o, Tuple const &t, std::map< std::string, msgpack::object const * > const &kvmap)
Definition: cpp11_define_map.hpp:32
static void pack(Packer &pk, Tuple const &t)
Definition: cpp11_define_map.hpp:28
static void object(msgpack::object *o, msgpack::zone &z, Tuple const &t)
Definition: cpp11_define_map.hpp:41
Definition: cpp11_define_map.hpp:59
void msgpack_unpack(msgpack::object const &o) const
Definition: cpp11_define_map.hpp:70
define_map(Args &... args)
Definition: cpp11_define_map.hpp:60
void msgpack_pack(Packer &pk) const
Definition: cpp11_define_map.hpp:63
std::tuple< Args &... > a
Definition: cpp11_define_map.hpp:94
void msgpack_object(msgpack::object *o, msgpack::zone &z) const
Definition: cpp11_define_map.hpp:84
msgpack::object_str str
Definition: object_fwd.hpp:87
msgpack::object_map map
Definition: object_fwd.hpp:86
#define MSGPACK_ZONE_ALIGNOF(type)
Definition: cpp03_zone_decl.hpp:30
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:66