10 #ifndef MSGPACK_V1_CPP11_MSGPACK_TUPLE_HPP 11 #define MSGPACK_V1_CPP11_MSGPACK_TUPLE_HPP 25 template <
class... Args>
27 return tuple<Args...>(std::forward<Args>(args)...);
30 template<
class... Args>
32 return tuple<Args&&...>(std::forward<Args>(args)...);
35 template <
class... Tuples>
38 std::tuple_cat(std::forward<
typename std::remove_reference<Tuples>::type::base>(args)...)
40 return std::tuple_cat(std::forward<
typename std::remove_reference<Tuples>::type::base>(args)...);
43 template <
class... Args>
45 return tuple<Args&...>(args...);
50 template <
typename Stream,
typename Tuple, std::
size_t N>
56 o.
pack(type::get<N-1>(v));
60 template <
typename Stream,
typename Tuple>
65 o.
pack(type::get<0>(v));
69 template <
typename Stream,
typename Tuple>
79 template <
typename... Args>
81 template <
typename Stream>
95 template <
typename T,
typename... Args>
104 template <
typename... Args>
118 template <
typename Tuple, std::
size_t N>
124 o.
via.
array.
ptr[N-1].
convert<
typename std::remove_reference<decltype(type::get<N-1>(v))>::type>(type::get<N-1>(v));
128 template <
typename Tuple>
133 o.
via.
array.
ptr[0].
convert<
typename std::remove_reference<decltype(type::get<0>(v))>::type>(type::get<0>(v));
137 template <
typename Tuple>
147 template <
typename... Args>
148 struct as<
msgpack::
type::tuple<Args...>, typename std::enable_if<msgpack::all_of<msgpack::has_as, Args...>::value>::type> {
157 template <
typename... Args>
172 template <
typename Tuple, std::
size_t N>
182 template <
typename Tuple>
191 template <
typename Tuple>
201 template <
typename... Args>
221 #endif // MSGPACK_CPP11_MSGPACK_TUPLE_HPP tuple< Args &... > tie(Args &...args)
Definition: cpp11_msgpack_tuple.hpp:44
msgpack::object const & operator()(msgpack::object const &o, msgpack::type::tuple< Args... > &v) const
Definition: cpp11_msgpack_tuple.hpp:159
uint32_t size
Definition: object_fwd.hpp:23
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition: cpp03_zone.hpp:236
static msgpack::type::tuple< Args... > as(msgpack::object const &o)
Definition: cpp11_msgpack_tuple.hpp:106
static void convert(msgpack::object::with_zone &, const Tuple &)
Definition: cpp11_msgpack_tuple.hpp:193
Definition: object_fwd_decl.hpp:60
union_type via
Definition: object_fwd.hpp:92
static void convert(msgpack::object::with_zone &o, const Tuple &v)
Definition: cpp11_msgpack_tuple.hpp:174
msgpack::zone & zone
Definition: object.hpp:36
msgpack::type::tuple< Args... > operator()(msgpack::object const &o) const
Definition: cpp11_msgpack_tuple.hpp:149
msgpack::object * ptr
Definition: object_fwd.hpp:24
static void convert(msgpack::object const &o, Tuple &v)
Definition: cpp11_msgpack_tuple.hpp:130
packer< Stream > & pack_array(uint32_t n)
Packing array header and size.
Definition: pack.hpp:1160
Definition: adaptor_base.hpp:15
static void pack(msgpack::packer< Stream > &o, const Tuple &v)
Definition: cpp11_msgpack_tuple.hpp:52
static void convert(msgpack::object::with_zone &o, const Tuple &v)
Definition: cpp11_msgpack_tuple.hpp:184
Definition: cpp11_msgpack_tuple.hpp:173
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: cpp11_msgpack_tuple.hpp:51
Definition: cpp03_msgpack_tuple.hpp:9165
std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition: object.hpp:567
Definition: adaptor_base.hpp:43
tuple make_tuple()
Definition: cpp03_msgpack_tuple.hpp:10375
Definition: object_fwd.hpp:222
static void pack(msgpack::packer< Stream > &, const Tuple &)
Definition: cpp11_msgpack_tuple.hpp:71
Definition: adaptor_base.hpp:32
msgpack::object_array array
Definition: object_fwd.hpp:84
void pack(msgpack::packer< Stream > &o, const T &v)
Definition: object.hpp:647
static msgpack::type::tuple as(msgpack::object const &)
Definition: cpp11_msgpack_tuple.hpp:113
static void pack(msgpack::packer< Stream > &o, const Tuple &v)
Definition: cpp11_msgpack_tuple.hpp:62
T & convert(T &v) const
Convert the object.
Definition: object.hpp:529
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
static void convert(msgpack::object const &o, Tuple &v)
Definition: cpp11_msgpack_tuple.hpp:120
Definition: cpp11_msgpack_tuple.hpp:105
msgpack::type::object_type type
Definition: object_fwd.hpp:91
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
Definition: object_fwd_decl.hpp:39
static void convert(msgpack::object const &, Tuple &)
Definition: cpp11_msgpack_tuple.hpp:139
tuple< Args &&... > forward_as_tuple(Args &&...args) noexcept
Definition: cpp11_msgpack_tuple.hpp:31
void operator()(msgpack::object::with_zone &o, msgpack::type::tuple< Args... > const &v) const
Definition: cpp11_msgpack_tuple.hpp:203
Definition: cpp11_msgpack_tuple_decl.hpp:35
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const msgpack::type::tuple< Args... > &v) const
Definition: cpp11_msgpack_tuple.hpp:82
auto tuple_cat(Tuples &&...args) -> decltype(std::tuple_cat(std::forward< typename std::remove_reference< Tuples >::type::base >(args)...))
Definition: cpp11_msgpack_tuple.hpp:36
The class template that supports continuous packing.
Definition: adaptor_base_decl.hpp:23
static msgpack::type::tuple< T, Args... > as(msgpack::object const &o)
Definition: cpp11_msgpack_tuple.hpp:97
Definition: cpp11_msgpack_tuple.hpp:119
Definition: cpp11_msgpack_tuple.hpp:96
Definition: adaptor_base.hpp:27