10#ifndef MSGPACK_V1_TYPE_BOOST_FUSION_HPP
11#define MSGPACK_V1_TYPE_BOOST_FUSION_HPP
20#if !defined (MSGPACK_USE_CPP03)
25#pragma GCC diagnostic push
26#pragma GCC diagnostic ignored "-Wconversion"
29#include <boost/fusion/support/is_sequence.hpp>
30#include <boost/fusion/sequence/intrinsic/size.hpp>
31#include <boost/fusion/algorithm/iteration/for_each.hpp>
32#include <boost/fusion/sequence/intrinsic/at.hpp>
33#include <boost/fusion/include/mpl.hpp>
37#pragma GCC diagnostic pop
41#include <boost/mpl/size.hpp>
55 static bool const value =
false;
58template <
typename T,
typename U>
63#if !defined(MSGPACK_USE_CPP03)
67 static bool const value =
false;
70template <
typename... Args>
80 boost::fusion::traits::is_sequence<T>::value
83#if !defined (MSGPACK_USE_CPP03)
92#if !defined (MSGPACK_USE_CPP03)
98 detail::is_seq_no_pair_no_tuple<T>::value &&
101 boost::mpl::bool_<true>,
105 msgpack::has_as<boost::mpl::_2>
107 boost::mpl::bool_<true>,
108 boost::mpl::bool_<false>
118 using tuple_t =
decltype(to_tuple(std::declval<T>(),
gen_seq<boost::mpl::size<T>::value>()));
123 template<std::size_t... Is,
typename U>
125 typename std::remove_reference<
126 typename boost::fusion::result_of::at_c<T, static_cast<int>(Is)>::type
131 template<std::size_t... Is,
typename U>
133 return T(std::get<Is>(u)...);
140struct convert<T, typename
msgpack::enable_if<detail::is_seq_no_pair_no_tuple<T>::value>::type > {
147 boost::fusion::for_each(v, convert_imp(o, index));
152 convert_imp(
msgpack::object const& obj, uint32_t& index):obj_(obj), index_(index) {}
153 template <
typename U>
164struct pack<T, typename
msgpack::enable_if<detail::is_seq_no_pair_no_tuple<T>::value>::type > {
165 template <
typename Stream>
169 boost::fusion::for_each(v, pack_imp<Stream>(o));
173 template <
typename Stream>
176 template <
typename U>
193 boost::fusion::for_each(v, with_zone_imp(o, count));
196 struct with_zone_imp {
198 template <
typename U>
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:231
void * allocate_align(size_t size, size_t align=MSGPACK_ZONE_ALIGN)
Definition: cpp03_zone.hpp:255
tuple make_tuple()
Definition: cpp03_msgpack_tuple.hpp:10408
std::size_t size(T const &t)
Definition: size_equal_only.hpp:24
@ ARRAY
Definition: object_fwd_decl.hpp:40
Definition: adaptor_base.hpp:15
uint32_t checked_get_container_size(T size)
Definition: check_container_size.hpp:55
static std::tuple< typename std::remove_reference< typename boost::fusion::result_of::at_c< T, static_cast< int >(Is)>::type >::type... > to_tuple(U const &u, seq< Is... >)
Definition: fusion.hpp:128
T operator()(msgpack::object const &o) const
Definition: fusion.hpp:113
static T to_t(U const &u, seq< Is... >)
Definition: fusion.hpp:132
Definition: object_fwd_decl.hpp:61
msgpack::object const & operator()(msgpack::object const &o, T &v) const
Definition: fusion.hpp:141
Definition: adaptor_base.hpp:27
msgpack::object const & operator()(msgpack::object const &o, T &v) const
Definition: object.hpp:646
Definition: fusion.hpp:78
static bool const value
Definition: fusion.hpp:79
Definition: fusion.hpp:54
static bool const value
Definition: fusion.hpp:55
Definition: fusion.hpp:66
static bool const value
Definition: fusion.hpp:67
void operator()(msgpack::object::with_zone &o, const T &v) const
Definition: fusion.hpp:187
Definition: adaptor_base.hpp:43
void operator()(msgpack::object::with_zone &o, T const &v) const
Definition: object.hpp:662
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const T &v) const
Definition: fusion.hpp:166
Definition: adaptor_base.hpp:32
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, T const &v) const
Definition: object.hpp:655
Definition: object.hpp:35
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_ZONE_ALIGNOF(type)
Definition: cpp03_zone_decl.hpp:30
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:66