6#include <boost/config.hpp>
7#include <boost/version.hpp>
11#include <boost/interprocess/containers/map.hpp>
12#include <boost/interprocess/containers/string.hpp>
13#include <boost/interprocess/containers/vector.hpp>
16#ifdef USE_BOOST_ARCHIVE
17#include <boost/serialization/utility.hpp>
18#include <boost/serialization/collections_save_imp.hpp>
19#include <boost/serialization/collections_load_imp.hpp>
20#include <boost/serialization/split_free.hpp>
21#include <boost/serialization/map.hpp>
22#include <boost/serialization/string.hpp>
23#include <boost/serialization/level.hpp>
24#include <boost/serialization/array.hpp>
25#include <boost/serialization/vector.hpp>
29#include <yas/serialize.hpp>
30#include <yas/boost_types.hpp>
31#include <yas/std_types.hpp>
32#include <yas/object.hpp>
36namespace serialization {
40#ifdef USE_BOOST_ARCHIVE
43template<
class Archive,
class Type,
class Key,
class Compare,
class Allocator>
44inline void save(Archive &ar,
const boost::interprocess::map<Key, Type, Compare, Allocator> &t,
48 boost::serialization::stl::save_collection<Archive, boost::interprocess::map<Key, Type, Compare, Allocator>>(ar, t);
51template<
class Archive,
class Type,
class Key,
class Compare,
class Allocator>
52inline void load(Archive &ar, boost::interprocess::map<Key, Type, Compare, Allocator> &t,
56#if BOOST_VERSION >= 105900
57 boost::serialization::load_map_collection<Archive, boost::interprocess::map<Key, Type, Compare, Allocator>>(ar, t);
59 boost::serialization::stl::load_collection<
60 Archive, boost::interprocess::map<Key, Type, Compare, Allocator>,
61 boost::serialization::stl::archive_input_map<Archive, boost::interprocess::map<Key, Type, Compare, Allocator>>,
62 boost::serialization::stl::no_reserve_imp<boost::interprocess::map<Key, Type, Compare, Allocator>>>(ar, t);
68template<
class Archive,
class Type,
class Key,
class Compare,
class Allocator>
69inline void serialize(Archive &ar, boost::interprocess::map<Key, Type, Compare, Allocator> &t,
70 const unsigned int file_version)
72 boost::serialization::split_free(ar, t, file_version);
79#ifdef USE_BOOST_ARCHIVE
82template<
class Archive,
class U,
class Allocator>
83inline void save(Archive &ar,
const boost::container::vector<U, Allocator> &t,
const unsigned int
86 size_t count = t.size();
87 ar &boost::serialization::make_nvp(
"count", count);
90 ar &boost::serialization::make_nvp(
"item", *it);
95template<
class Archive,
class U,
class Allocator>
96inline void load(Archive &ar, boost::container::vector<U, Allocator> &t,
const unsigned int
100 ar &boost::serialization::make_nvp(
"count", count);
103 while (count-- > 0) {
104 detail::stack_construct<Archive, U> u(ar, 0);
105 ar >> boost::serialization::make_nvp(
"item", u.reference());
106 t.push_back(u.reference());
107 ar.reset_object_address(&t.back(), &u.reference());
113template<
class Archive,
class Type,
class Allocator>
114inline void serialize(Archive &ar, boost::container::vector<Type, Allocator> &t,
const unsigned int file_version)
116 boost::serialization::split_free(ar, t, file_version);
122#ifdef USE_BOOST_ARCHIVE
125template<
class Archive,
class CharT,
class Allocator>
126inline void save(Archive &ar,
const boost::container::basic_string<CharT, std::char_traits<CharT>, Allocator> &t,
127 const unsigned int file_version)
129 size_t count = t.size();
130 ar &boost::serialization::make_nvp(
"count", count);
132 while (count-- > 0) {
133 ar &boost::serialization::make_nvp(
"item", *it);
138template<
class Archive,
class CharT,
class Allocator>
139inline void load(Archive &ar, boost::container::basic_string<CharT, std::char_traits<CharT>, Allocator> &t,
140 const unsigned int file_version)
143 ar &boost::serialization::make_nvp(
"count", count);
146 while (count-- > 0) {
147 detail::stack_construct<Archive, CharT> u(ar, 0);
148 ar >> boost::serialization::make_nvp(
"item", u.reference());
149 t.push_back(u.reference());
150 ar.reset_object_address(&t[t.length() - 1], &u.reference());
156template<
class Archive,
class CharT,
class Allocator>
157inline void serialize(Archive &ar, boost::container::basic_string<CharT, std::char_traits<CharT>, Allocator> &t,
158 const unsigned int file_version)
160 boost::serialization::split_free(ar, t, file_version);
void serialize(Archive &ar, vistle::Vector1 &v, const unsigned int version)
Definition: vector.h:105
Definition: serialize.h:35