14 #ifndef INCLUDED_utility_serialization_serialization_HH
15 #define INCLUDED_utility_serialization_serialization_HH
22 #include <cereal/archives/binary.hpp>
23 #include <cereal/archives/xml.hpp>
24 #include <cereal/archives/json.hpp>
30 #define SERIALIZABLE(T) \
31 template void T::serialize(cereal::BinaryOutputArchive&); \
32 template void T::serialize(cereal::BinaryInputArchive&); \
33 template void T::serialize(cereal::XMLOutputArchive&); \
34 template void T::serialize(cereal::XMLInputArchive&); \
35 template void T::serialize(cereal::JSONOutputArchive&); \
36 template void T::serialize(cereal::JSONInputArchive&)
40 #define SAVE_AND_LOAD_SERIALIZABLE(T) \
41 template void T::save( typename cereal::BinaryOutputArchive &) const; \
42 template void T::save( typename cereal::XMLOutputArchive &) const; \
43 template void T::save( typename cereal::JSONOutputArchive &) const; \
44 template void T::load( typename cereal::BinaryInputArchive &); \
45 template void T::load( typename cereal::XMLInputArchive &); \
46 template void T::load( typename cereal::JSONInputArchive &)
48 #define EXTERNAL_SAVE_AND_LOAD_SERIALIZABLE( T ) \
49 template void save( typename cereal::BinaryOutputArchive &, T const & ); \
50 template void save( typename cereal::XMLOutputArchive &, T const & ); \
51 template void save( typename cereal::JSONOutputArchive &, T const & ); \
52 template void load( typename cereal::BinaryInputArchive &, T & ); \
53 template void load( typename cereal::XMLInputArchive &, T & ); \
54 template void load( typename cereal::JSONInputArchive &, T & )
56 #define SAVE_AND_LOAD_AND_CONSTRUCT_SERIALIZABLE( T ) \
57 template void T::save( typename cereal::BinaryOutputArchive &) const; \
58 template void T::save( typename cereal::XMLOutputArchive &) const; \
59 template void T::save( typename cereal::JSONOutputArchive &) const; \
60 template void T::load_and_construct( typename cereal::BinaryInputArchive &, cereal::construct< T > & construct ); \
61 template void T::load_and_construct( typename cereal::XMLInputArchive &, cereal::construct< T > & construct ); \
62 template void T::load_and_construct( typename cereal::JSONInputArchive &, cereal::construct< T > & construct )
72 #define INSTANTIATE_FOR_OUTPUT_ARCHIVES( return_type, func, param ) \
73 template return_type func( typename cereal::BinaryOutputArchive &, param ); \
74 template return_type func( typename cereal::XMLOutputArchive &, param ); \
75 template return_type func( typename cereal::JSONOutputArchive &, param )
85 #define INSTANTIATE_FOR_INPUT_ARCHIVES( return_type, func, param ) \
86 template return_type func( typename cereal::BinaryInputArchive &, param ); \
87 template return_type func( typename cereal::XMLInputArchive &, param ); \
88 template return_type func( typename cereal::JSONInputArchive &, param )
94 namespace serialization {
99 #endif // SERIALIZATION
101 #endif // INCLUDED_utility_serialization_serialization_HH
vector1: std::vector with 1-based indexing