27 #ifndef TESSERACT_COMMON_ATOMIC_SERIALIZATION_H
28 #define TESSERACT_COMMON_ATOMIC_SERIALIZATION_H
32 #include <boost/serialization/serialization.hpp>
33 #include <boost/serialization/split_free.hpp>
34 #include <boost/serialization/nvp.hpp>
41 template <
class Archive,
class T>
42 inline void save(Archive& ar,
const std::atomic<T>& t,
const unsigned int)
44 const T value = t.load();
45 ar& BOOST_SERIALIZATION_NVP(value);
48 template <
class Archive,
class T>
49 inline void load(Archive& ar, std::atomic<T>& t,
const unsigned int)
52 ar& BOOST_SERIALIZATION_NVP(value);
56 template <
class Archive,
class T>
57 inline void serialize(Archive& ar, std::atomic<T>& t,
const unsigned int version)
59 boost::serialization::split_free(ar, t, version);
62 #endif // TESSERACT_COMMON_ATOMIC_SERIALIZATION_H