diff options
Diffstat (limited to 'src/system.hh.in')
-rw-r--r-- | src/system.hh.in | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/src/system.hh.in b/src/system.hh.in index 07598173..4a7dc55f 100644 --- a/src/system.hh.in +++ b/src/system.hh.in @@ -138,7 +138,6 @@ typedef std::ostream::pos_type ostream_pos_type; #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/predicate.hpp> -#include <boost/any.hpp> #include <boost/bind.hpp> #include <boost/cast.hpp> #include <boost/current_function.hpp> @@ -168,6 +167,74 @@ typedef std::ostream::pos_type ostream_pos_type; #include <boost/variant.hpp> #include <boost/version.hpp> +#if defined(HAVE_BOOST_SERIALIZATION) + +#include <boost/archive/binary_iarchive.hpp> +#include <boost/archive/binary_oarchive.hpp> + +#include <boost/serialization/base_object.hpp> +#include <boost/serialization/binary_object.hpp> +#include <boost/serialization/optional.hpp> +#include <boost/serialization/shared_ptr.hpp> +#include <boost/serialization/variant.hpp> +#include <boost/serialization/utility.hpp> +#include <boost/serialization/export.hpp> +#include <boost/serialization/level.hpp> +#include <boost/serialization/string.hpp> +#include <boost/serialization/vector.hpp> +#include <boost/serialization/deque.hpp> +#include <boost/serialization/list.hpp> +#include <boost/serialization/map.hpp> + +#include <boost/date_time/posix_time/time_serialize.hpp> +#include <boost/date_time/gregorian/greg_serialize.hpp> + +namespace boost { +namespace serialization { + +template <class Archive> +void serialize(Archive& ar, boost::filesystem::path& p, const unsigned int) +{ + std::string s; + if (Archive::is_saving::value) + s = p.string(); + + ar & s; + + if (Archive::is_loading::value) + p = s; +} + +template <class Archive, class T> +void serialize(Archive& ar, boost::intrusive_ptr<T>& ptr, const unsigned int) +{ + if (Archive::is_saving::value) { + T * p = ptr.get(); + ar & p; + } + else if (Archive::is_loading::value) { + T * p; + ar & p; + ptr.reset(p); + } +} + +template <class Archive, class T> +void serialize(Archive&, boost::function<T>&, const unsigned int) +{ +} + +template <class Archive> +void serialize(Archive& ar, istream_pos_type& pos, const unsigned int) +{ + ar & make_binary_object(&pos, sizeof(istream_pos_type)); +} + +} // namespace serialization +} // namespace boost + +#endif // HAVE_BOOST_SERIALIZATION + #if defined(HAVE_BOOST_PYTHON) #include <boost/python.hpp> |