31 #if BOOST_VERSION <= 104000 32 #pragma GCC diagnostic ignored "-Wsign-compare" 37 #include <boost/archive/binary_iarchive.hpp> 38 #include <boost/archive/binary_oarchive.hpp> 41 #include <boost/tuple/tuple.hpp> 46 namespace serialization
48 template<
typename T,
typename Archive>
60 template<
typename T,
typename Archive>
74 template<
typename Archive>
77 typedef boost::function<void(Archive&, tendril&)>
serial_fn_t;
80 template<
typename Serializer>
82 add(
const Serializer& s)
85 typedef typename Serializer::value_type
value_type;
86 const std::string& name = name_of<value_type>();
87 serial_fn_t fnc = serial_fn_t(s);
92 add(
const std::string& name, serial_fn_t fnc);
94 serialize(
const std::string& key, Archive& ar,
tendril& t)
const;
132 #define ECTO_REGISTER_SERIALIZERS(Type) \ 134 namespace serialization{ \ 135 template struct register_serializer<Type>; \ 139 #define ECTO_INSTANTIATE_SERIALIZATION(T) \ 140 template void T::serialize(boost::archive::binary_oarchive&, const unsigned int); \ 141 template void T::serialize(boost::archive::binary_iarchive&, const unsigned int); static const register_serializer instance
Definition: registry.hpp:117
std::map< std::string, serial_fn_t > serial_map_t
Definition: registry.hpp:78
#define ECTO_LOG_DEBUG(fmg, args)
Definition: log.hpp:66
Definition: registry.hpp:112
Definition: registry.hpp:49
bool is_type() const
runtime check if the tendril is of the given type.
Definition: tendril.hpp:217
boost::function< void(Archive &, tendril &)> serial_fn_t
Definition: registry.hpp:77
Definition: parameters.hpp:11
bool add(const ecto::tendril &t)
Definition: tendril.hpp:65
T value_type
Definition: registry.hpp:63
static registry< Archive > & instance()
Definition: registry.hpp:75
reader_< T, boost::archive::binary_iarchive > reader_binary_ia
Definition: registry.hpp:115
serial_map_t serial_map
Definition: registry.hpp:96
T value_type
Definition: registry.hpp:51
Definition: registry.hpp:61
A tendril is the slender, winding organ of the ecto::cell that gives it its awesome type erasure and ...
Definition: tendril.hpp:84
void add(const Serializer &s)
Definition: registry.hpp:82
registry< boost::archive::binary_oarchive > registry_binary_oa
Definition: registry.hpp:107
register_serializer()
Definition: registry.hpp:118
void operator()(Archive &ar, tendril &t) const
Definition: registry.hpp:65
writer_< T, boost::archive::binary_oarchive > writer_binary_oa
Definition: registry.hpp:114
const T & get() const
Definition: tendril.hpp:179
void operator()(Archive &ar, const tendril &t) const
Definition: registry.hpp:53
registry< boost::archive::binary_iarchive > registry_binary_ia
Definition: registry.hpp:108