3 #ifndef CPPQEDCORE_UTILS_ARCHIVE_H_INCLUDED
4 #define CPPQEDCORE_UTILS_ARCHIVE_H_INCLUDED
6 #include "core_config.h"
8 #ifdef DO_NOT_USE_BOOST_SERIALIZATION
13 #include <boost/mpl/bool.hpp>
23 class trivial_iarchive {
25 typedef boost::mpl::bool_<false> is_saving;
26 typedef boost::mpl::bool_<true> is_loading;
28 trivial_iarchive(std::istream&) {}
30 template<
class T>
void register_type(){}
31 template<
class T> trivial_iarchive & operator>>(
const T & ){
34 template<
class T> trivial_iarchive & operator&(
const T & t){
37 void load_binary(
void *, std::size_t){};
43 class trivial_oarchive {
45 typedef boost::mpl::bool_<true> is_saving;
46 typedef boost::mpl::bool_<false> is_loading;
48 trivial_oarchive(std::ostream&) {}
50 template<
class T>
void register_type(){}
51 template<
class T> trivial_oarchive & operator<<(
const T & ){
54 template<
class T> trivial_oarchive & operator&(
const T & t){
57 void save_binary(
void *, std::size_t){};
66 #else // DO_NOT_USE_BOOST_SERIALIZATION
68 #include <boost/archive/binary_oarchive.hpp>
69 #include <boost/archive/binary_iarchive.hpp>
73 typedef boost::archive::binary_iarchive
iarchive;
74 typedef boost::archive::binary_oarchive
oarchive;
78 #endif // DO_NOT_USE_BOOST_SERIALIZATION
80 #endif // CPPQEDCORE_UTILS_ARCHIVE_H_INCLUDED
Namespace comprising otherwise hard-to-classify generic utilities.
boost::archive::binary_oarchive oarchive
delegated to Boost.Serialization
boost::archive::binary_iarchive iarchive
delegated to Boost.Serialization