1 #ifndef BOOST_SERIALIZATION_HASH_SET_HPP
2 #define BOOST_SERIALIZATION_HASH_SET_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // hash_set.hpp: serialization for stl hash_set templates
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/config.hpp>
21 #include BOOST_HASH_SET_HEADER
23 #include <boost/serialization/hash_collections_save_imp.hpp>
24 #include <boost/serialization/hash_collections_load_imp.hpp>
25 #include <boost/serialization/split_free.hpp>
26 #include <boost/move/utility_core.hpp>
29 namespace serialization {
34 template<class Archive, class Container>
35 struct archive_input_hash_set
37 inline void operator()(
42 typedef typename Container::value_type type;
43 detail::stack_construct<Archive, type> t(ar, v);
44 // borland fails silently w/o full namespace
45 ar >> boost::serialization::make_nvp("item", t.reference());
46 std::pair<typename Container::const_iterator, bool> result =
47 s.insert(boost::move(t.reference()));
49 ar.reset_object_address(& (* result.first), & t.reference());
53 // hash_multiset input
54 template<class Archive, class Container>
55 struct archive_input_hash_multiset
57 inline void operator()(
62 typedef typename Container::value_type type;
63 detail::stack_construct<Archive, type> t(ar, v);
64 // borland fails silently w/o full namespace
65 ar >> boost::serialization::make_nvp("item", t.reference());
66 typename Container::const_iterator result
67 = s.insert(boost::move(t.reference()));
68 ar.reset_object_address(& (* result), & t.reference());
83 const BOOST_STD_EXTENSION_NAMESPACE::hash_set<
84 Key, HashFcn, EqualKey, Allocator
86 const unsigned int file_version
88 boost::serialization::stl::save_hash_collection<
90 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
91 Key, HashFcn, EqualKey, Allocator
105 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
106 Key, HashFcn, EqualKey, Allocator
108 const unsigned int file_version
110 boost::serialization::stl::load_hash_collection<
112 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
113 Key, HashFcn, EqualKey, Allocator
115 boost::serialization::stl::archive_input_hash_set<
117 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
118 Key, HashFcn, EqualKey, Allocator
124 // split non-intrusive serialization function member into separate
125 // non intrusive save/load member functions
133 inline void serialize(
135 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
136 Key, HashFcn, EqualKey, Allocator
138 const unsigned int file_version
140 boost::serialization::split_free(ar, t, file_version);
153 const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
154 Key, HashFcn, EqualKey, Allocator
156 const unsigned int file_version
158 boost::serialization::stl::save_hash_collection<
160 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
161 Key, HashFcn, EqualKey, Allocator
175 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
176 Key, HashFcn, EqualKey, Allocator
178 const unsigned int file_version
180 boost::serialization::stl::load_hash_collection<
182 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
183 Key, HashFcn, EqualKey, Allocator
185 boost::serialization::stl::archive_input_hash_multiset<
187 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
188 Key, HashFcn, EqualKey, Allocator
194 // split non-intrusive serialization function member into separate
195 // non intrusive save/load member functions
203 inline void serialize(
205 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
206 Key, HashFcn, EqualKey, Allocator
208 const unsigned int file_version
210 boost::serialization::split_free(ar, t, file_version);
213 } // namespace serialization
216 #include <boost/serialization/collection_traits.hpp>
218 BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_set)
219 BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_multiset)
221 #endif // BOOST_HAS_HASH
222 #endif // BOOST_SERIALIZATION_HASH_SET_HPP