1 | #ifndef BOOST_SERIALIZATION_HASH_SET_HPP |
---|
2 | #define BOOST_SERIALIZATION_HASH_SET_HPP |
---|
3 | |
---|
4 | // MS compatible compilers support #pragma once |
---|
5 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
---|
6 | # pragma once |
---|
7 | #endif |
---|
8 | |
---|
9 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 |
---|
10 | // hash_set.hpp: serialization for stl hash_set templates |
---|
11 | |
---|
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) |
---|
16 | |
---|
17 | // See http://www.boost.org for updates, documentation, and revision history. |
---|
18 | |
---|
19 | #include <boost/config.hpp> |
---|
20 | #ifdef BOOST_HAS_HASH |
---|
21 | #include BOOST_HASH_SET_HEADER |
---|
22 | |
---|
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 | |
---|
27 | namespace boost { |
---|
28 | namespace serialization { |
---|
29 | |
---|
30 | template< |
---|
31 | class Archive, |
---|
32 | class Key, |
---|
33 | class HashFcn, |
---|
34 | class EqualKey, |
---|
35 | class Allocator |
---|
36 | > |
---|
37 | inline void save( |
---|
38 | Archive & ar, |
---|
39 | const BOOST_STD_EXTENSION_NAMESPACE::hash_set< |
---|
40 | Key, HashFcn, EqualKey, Allocator |
---|
41 | > &t, |
---|
42 | const unsigned int file_version |
---|
43 | ){ |
---|
44 | boost::serialization::stl::save_hash_collection< |
---|
45 | Archive, |
---|
46 | BOOST_STD_EXTENSION_NAMESPACE::hash_set< |
---|
47 | Key, HashFcn, EqualKey, Allocator |
---|
48 | > |
---|
49 | >(ar, t); |
---|
50 | } |
---|
51 | |
---|
52 | template< |
---|
53 | class Archive, |
---|
54 | class Key, |
---|
55 | class HashFcn, |
---|
56 | class EqualKey, |
---|
57 | class Allocator |
---|
58 | > |
---|
59 | inline void load( |
---|
60 | Archive & ar, |
---|
61 | BOOST_STD_EXTENSION_NAMESPACE::hash_set< |
---|
62 | Key, HashFcn, EqualKey, Allocator |
---|
63 | > &t, |
---|
64 | const unsigned int file_version |
---|
65 | ){ |
---|
66 | boost::serialization::stl::load_hash_collection< |
---|
67 | Archive, |
---|
68 | BOOST_STD_EXTENSION_NAMESPACE::hash_set< |
---|
69 | Key, HashFcn, EqualKey, Allocator |
---|
70 | >, |
---|
71 | boost::serialization::stl::archive_input_unique< |
---|
72 | Archive, |
---|
73 | BOOST_STD_EXTENSION_NAMESPACE::hash_set< |
---|
74 | Key, HashFcn, EqualKey, Allocator |
---|
75 | > |
---|
76 | > |
---|
77 | >(ar, t); |
---|
78 | } |
---|
79 | |
---|
80 | // split non-intrusive serialization function member into separate |
---|
81 | // non intrusive save/load member functions |
---|
82 | template< |
---|
83 | class Archive, |
---|
84 | class Key, |
---|
85 | class HashFcn, |
---|
86 | class EqualKey, |
---|
87 | class Allocator |
---|
88 | > |
---|
89 | inline void serialize( |
---|
90 | Archive & ar, |
---|
91 | BOOST_STD_EXTENSION_NAMESPACE::hash_set< |
---|
92 | Key, HashFcn, EqualKey, Allocator |
---|
93 | > &t, |
---|
94 | const unsigned int file_version |
---|
95 | ){ |
---|
96 | boost::serialization::split_free(ar, t, file_version); |
---|
97 | } |
---|
98 | |
---|
99 | // hash_multiset |
---|
100 | template< |
---|
101 | class Archive, |
---|
102 | class Key, |
---|
103 | class HashFcn, |
---|
104 | class EqualKey, |
---|
105 | class Allocator |
---|
106 | > |
---|
107 | inline void save( |
---|
108 | Archive & ar, |
---|
109 | const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< |
---|
110 | Key, HashFcn, EqualKey, Allocator |
---|
111 | > &t, |
---|
112 | const unsigned int file_version |
---|
113 | ){ |
---|
114 | boost::serialization::stl::save_hash_collection< |
---|
115 | Archive, |
---|
116 | BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< |
---|
117 | Key, HashFcn, EqualKey, Allocator |
---|
118 | > |
---|
119 | >(ar, t); |
---|
120 | } |
---|
121 | |
---|
122 | template< |
---|
123 | class Archive, |
---|
124 | class Key, |
---|
125 | class HashFcn, |
---|
126 | class EqualKey, |
---|
127 | class Allocator |
---|
128 | > |
---|
129 | inline void load( |
---|
130 | Archive & ar, |
---|
131 | BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< |
---|
132 | Key, HashFcn, EqualKey, Allocator |
---|
133 | > &t, |
---|
134 | const unsigned int file_version |
---|
135 | ){ |
---|
136 | boost::serialization::stl::load_hash_collection< |
---|
137 | Archive, |
---|
138 | BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< |
---|
139 | Key, HashFcn, EqualKey, Allocator |
---|
140 | >, |
---|
141 | boost::serialization::stl::archive_input_multi< |
---|
142 | Archive, |
---|
143 | BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< |
---|
144 | Key, HashFcn, EqualKey, Allocator |
---|
145 | > |
---|
146 | > |
---|
147 | >(ar, t); |
---|
148 | } |
---|
149 | |
---|
150 | // split non-intrusive serialization function member into separate |
---|
151 | // non intrusive save/load member functions |
---|
152 | template< |
---|
153 | class Archive, |
---|
154 | class Key, |
---|
155 | class HashFcn, |
---|
156 | class EqualKey, |
---|
157 | class Allocator |
---|
158 | > |
---|
159 | inline void serialize( |
---|
160 | Archive & ar, |
---|
161 | BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< |
---|
162 | Key, HashFcn, EqualKey, Allocator |
---|
163 | > & t, |
---|
164 | const unsigned int file_version |
---|
165 | ){ |
---|
166 | boost::serialization::split_free(ar, t, file_version); |
---|
167 | } |
---|
168 | |
---|
169 | } // namespace serialization |
---|
170 | } // namespace boost |
---|
171 | |
---|
172 | #include <boost/serialization/collection_traits.hpp> |
---|
173 | |
---|
174 | BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_set) |
---|
175 | BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_multiset) |
---|
176 | |
---|
177 | #endif // BOOST_HAS_HASH |
---|
178 | #endif // BOOST_SERIALIZATION_HASH_SET_HPP |
---|