2019-12-24 17:49:56 +00:00
|
|
|
#include <boost/serialization/serialization.hpp>
|
|
|
|
|
|
|
|
class construct_access {
|
|
|
|
public:
|
2019-12-27 21:07:29 +00:00
|
|
|
template <class Archive, class T>
|
|
|
|
static inline void save_construct(Archive& ar, const T* t, const unsigned int file_version) {
|
2019-12-24 17:49:56 +00:00
|
|
|
t->save_construct(ar, file_version);
|
|
|
|
}
|
2019-12-27 21:07:29 +00:00
|
|
|
template <class Archive, class T>
|
|
|
|
static inline void load_construct(Archive& ar, T* t, const unsigned int file_version) {
|
2019-12-24 17:49:56 +00:00
|
|
|
T::load_construct(ar, t, file_version);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-12-27 21:07:29 +00:00
|
|
|
#define BOOST_SERIALIZATION_CONSTRUCT(T) \
|
|
|
|
namespace boost { \
|
|
|
|
namespace serialization { \
|
|
|
|
template <class Archive> \
|
|
|
|
inline void save_construct_data(Archive& ar, const T* t, const unsigned int file_version) { \
|
|
|
|
construct_access::save_construct(ar, t, file_version); \
|
|
|
|
} \
|
|
|
|
template <class Archive> \
|
|
|
|
inline void load_construct_data(Archive& ar, T* t, const unsigned int file_version) { \
|
|
|
|
construct_access::load_construct(ar, t, file_version); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|