Added POD serialization
parent
6940c99ed6
commit
dc04774ece
@ -1 +1 @@
|
||||
Subproject commit 1acb9699ac8e91654331504cf3524b26463eeee4
|
||||
Subproject commit d2a5baa1ad701671a7ef547ef71cb0f0c80ce2cf
|
@ -0,0 +1,20 @@
|
||||
#include "boost/serialization/split_member.hpp"
|
||||
|
||||
#define SERIALIZE_AS_POD \
|
||||
private: \
|
||||
friend class boost::serialization::access; \
|
||||
template<typename Archive> \
|
||||
void save(Archive & ar, const unsigned int file_version) const { \
|
||||
ar.save_binary(this, sizeof(*this)); \
|
||||
} \
|
||||
template<typename Archive> \
|
||||
void load(Archive & ar, const unsigned int file_version) { \
|
||||
ar.load_binary(this, sizeof(*this)); \
|
||||
} \
|
||||
template<class Archive> \
|
||||
void serialize( \
|
||||
Archive &ar, \
|
||||
const unsigned int file_version \
|
||||
){ \
|
||||
boost::serialization::split_member(ar, *this, file_version); \
|
||||
}
|
Loading…
Reference in New Issue