10#ifndef MSGPACK_V1_TYPE_BOOST_FUSION_HPP
11#define MSGPACK_V1_TYPE_BOOST_FUSION_HPP
20#if !defined (MSGPACK_USE_CPP03)
24#include <boost/fusion/support/is_sequence.hpp>
25#include <boost/fusion/sequence/intrinsic/size.hpp>
26#include <boost/fusion/algorithm/iteration/for_each.hpp>
27#include <boost/fusion/sequence/intrinsic/at.hpp>
28#include <boost/fusion/include/mpl.hpp>
29#include <boost/mpl/size.hpp>
43 static bool const value =
false;
46template <
typename T,
typename U>
51#if !defined(MSGPACK_USE_CPP03)
55 static bool const value =
false;
58template <
typename... Args>
68 boost::fusion::traits::is_sequence<T>::value
71#if !defined (MSGPACK_USE_CPP03)
80#if !defined (MSGPACK_USE_CPP03)
86 detail::is_seq_no_pair_no_tuple<T>::value &&
89 boost::mpl::bool_<true>,
93 msgpack::has_as<boost::mpl::_2>
95 boost::mpl::bool_<true>,
96 boost::mpl::bool_<false>
106 using tuple_t =
decltype(to_tuple(std::declval<T>(),
gen_seq<boost::mpl::size<T>::value>()));
111 template<std::size_t... Is,
typename U>
113 typename std::remove_reference<
114 typename boost::fusion::result_of::at_c<T, Is>::type
117 return std::make_tuple(boost::fusion::at_c<Is>(u)...);
119 template<std::size_t... Is,
typename U>
121 return T(std::get<Is>(u)...);
135 boost::fusion::for_each(v, convert_imp(o, index));
140 convert_imp(
msgpack::object const& obj, uint32_t& index):obj_(obj), index_(index) {}
141 template <
typename U>
142 void operator()(U& v)
const {
153 template <
typename Stream>
157 boost::fusion::for_each(v, pack_imp<Stream>(o));
161 template <
typename Stream>
164 template <
typename U>
165 void operator()(U
const& v)
const {
177 o.
type = msgpack::type::ARRAY;
181 boost::fusion::for_each(v, with_zone_imp(o, count));
184 struct with_zone_imp {
186 template <
typename U>
187 void operator()(U
const& v)
const {
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
Definition object_fwd.hpp:236
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition cpp03_zone.hpp:246
Definition adaptor_base.hpp:15
uint32_t checked_get_container_size(T size)
Definition check_container_size.hpp:55
T operator()(msgpack::object const &o) const
Definition fusion.hpp:101
static T to_t(U const &u, seq< Is... >)
Definition fusion.hpp:120
static std::tuple< typename std::remove_reference< typename boost::fusion::result_of::at_c< T, Is >::type >::type... > to_tuple(U const &u, seq< Is... >)
Definition fusion.hpp:116
Definition object_fwd_decl.hpp:62
msgpack::object const & operator()(msgpack::object const &o, T &v) const
Definition fusion.hpp:129
Definition adaptor_base.hpp:27
static bool const value
Definition fusion.hpp:67
static bool const value
Definition fusion.hpp:43
static bool const value
Definition fusion.hpp:55
void operator()(msgpack::object::with_zone &o, const T &v) const
Definition fusion.hpp:175
Definition adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const T &v) const
Definition fusion.hpp:154
Definition adaptor_base.hpp:32
Definition cpp_config_decl.hpp:56
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:1121
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_ZONE_ALIGNOF(type)
Definition cpp03_zone_decl.hpp:30
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition versioning.hpp:58