5 #ifndef COAL_SERIALIZATION_FWD_H
6 #define COAL_SERIALIZATION_FWD_H
10 #include <boost/archive/text_iarchive.hpp>
11 #include <boost/archive/text_oarchive.hpp>
12 #include <boost/archive/xml_iarchive.hpp>
13 #include <boost/archive/xml_oarchive.hpp>
14 #include <boost/archive/binary_iarchive.hpp>
15 #include <boost/archive/binary_oarchive.hpp>
17 #include <boost/serialization/split_free.hpp>
18 #include <boost/serialization/shared_ptr.hpp>
19 #include <boost/serialization/export.hpp>
24 #define COAL_SERIALIZATION_SPLIT(Type) \
25 template <class Archive> \
26 void serialize(Archive& ar, Type& value, const unsigned int version) { \
27 split_free(ar, value, version); \
30 #define COAL_SERIALIZATION_DECLARE_EXPORT(T) \
31 BOOST_CLASS_EXPORT_KEY(T) \
35 namespace extra_detail { \
37 struct init_guid<T> { \
38 static guid_initializer<T> const& g; \
46 #define COAL_SERIALIZATION_DEFINE_EXPORT(T) \
50 namespace extra_detail { \
51 guid_initializer<T> const& init_guid<T>::g = \
52 ::boost::serialization::singleton< \
53 guid_initializer<T> >::get_mutable_instance() \
62 namespace serialization {
65 template <
class Derived,
class Base>
68 template <
class Derived,
class Base>
70 void init(std::true_type)
const {
71 boost::serialization::void_cast_register<Derived, Base>();
74 void init(std::false_type)
const {}
78 _Pragma(
"GCC diagnostic ignored \"-Wconversion\"")
79 BOOST_STATIC_WARNING((std::is_base_of<Base, Derived>::value));
81 init(std::is_base_of<Base, Derived>());
90 template <
class Archive>
91 static void on(Archive& ) {}
96 #define COAL_SERIALIZATION_CAST_REGISTER(Derived, Base) \
98 namespace serialization { \
101 struct init_cast_register<Derived, Base> { \
102 static cast_register_initializer<Derived, Base> const& g; \
104 cast_register_initializer<Derived, Base> const& init_cast_register< \
105 Derived, Base>::g = \
106 ::boost::serialization::singleton< \
107 cast_register_initializer<Derived, Base> >::get_mutable_instance() \
113 #endif // ifndef COAL_SERIALIZATION_FWD_H