40 #include <boost/variant/variant.hpp>
41 #include <boost/variant/apply_visitor.hpp>
42 #include <boost/variant/static_visitor.hpp>
43 #include <boost/mpl/empty.hpp>
44 #include <boost/mpl/if.hpp>
45 #include <boost/mpl/front.hpp>
46 #include <boost/mpl/pop_front.hpp>
55 template <
class Archive,
class T>
64 template <
class Archive,
class Variant,
class TBegin,
class TEnd>
68 typedef typename boost::mpl::next<TBegin>::type
TNext;
78 ar.stream().setstate(std::ios::failbit);
92 template <
class Archive,
class Variant,
class TBegin>
99 ar.stream().setstate(std::ios::failbit);
105 template <
template <
bool>
class Archive, BOOST_VARIANT_ENUM_PARAMS(
typename T)>
110 typedef typename variant_type::types
types;
115 ar.read_variant_tag(t);
117 typename boost::mpl::begin<types>::type,
118 typename boost::mpl::end<types>::type>::read(ar, v, t))
120 ar.stream().setstate(std::ios::failbit);
128 template <
template <
bool>
class Archive, BOOST_VARIANT_ENUM_PARAMS(
typename T)>
134 struct visitor :
public boost::static_visitor<bool>
141 bool operator ()(
T &rv)
const
147 ar.stream().setstate(std::ios::failbit);
156 return boost::apply_visitor(visitor(ar), v);
void do_serialize(boost::mpl::false_, Archive &a, epee::net_utils::network_address &na)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Simple DSL AAPI based on.
variant_type::types types
Archive< false >::variant_tag_type variant_tag_type
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)> variant_type
static bool serialize(Archive< false > &ar, variant_type &v)
visitor(Archive< true > &a)
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)> variant_type
static bool serialize(Archive< true > &ar, variant_type &v)
... wouldn't a class be better?
Archive::variant_tag_type variant_tag_type
static bool read(Archive &ar, Variant &v, variant_tag_type t)
boost::mpl::deref< TBegin >::type current_type
Archive::variant_tag_type variant_tag_type
static bool read(Archive &ar, Variant &v, variant_tag_type t)
boost::mpl::next< TBegin >::type TNext