1 | #ifndef BOOST_SERIALIZATION_BOOST_UNORDERED_SET_HPP |
2 | #define BOOST_SERIALIZATION_BOOST_UNORDERED_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 | // unordered_set.hpp: serialization for boost unordered_set templates |
11 | |
12 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
13 | // (C) Copyright 2014 Jim Bell |
14 | // Use, modification and distribution is subject to the Boost Software |
15 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
16 | // http://www.boost.org/LICENSE_1_0.txt) |
17 | |
18 | // See http://www.boost.org for updates, documentation, and revision history. |
19 | |
20 | #include <boost/config.hpp> |
21 | |
22 | #include <boost/unordered_set.hpp> |
23 | |
24 | #include <boost/serialization/unordered_collections_save_imp.hpp> |
25 | #include <boost/serialization/unordered_collections_load_imp.hpp> |
26 | #include <boost/serialization/archive_input_unordered_set.hpp> |
27 | #include <boost/serialization/split_free.hpp> |
28 | |
29 | namespace boost { |
30 | namespace serialization { |
31 | |
32 | template< |
33 | class Archive, |
34 | class Key, |
35 | class HashFcn, |
36 | class EqualKey, |
37 | class Allocator |
38 | > |
39 | inline void save( |
40 | Archive & ar, |
41 | const boost::unordered_set<Key, HashFcn, EqualKey, Allocator> &t, |
42 | const unsigned int /*file_version*/ |
43 | ){ |
44 | boost::serialization::stl::save_unordered_collection< |
45 | Archive, |
46 | boost::unordered_set<Key, HashFcn, EqualKey, Allocator> |
47 | >(ar, t); |
48 | } |
49 | |
50 | template< |
51 | class Archive, |
52 | class Key, |
53 | class HashFcn, |
54 | class EqualKey, |
55 | class Allocator |
56 | > |
57 | inline void load( |
58 | Archive & ar, |
59 | boost::unordered_set<Key, HashFcn, EqualKey, Allocator> &t, |
60 | const unsigned int /*file_version*/ |
61 | ){ |
62 | boost::serialization::stl::load_unordered_collection< |
63 | Archive, |
64 | boost::unordered_set<Key, HashFcn, EqualKey, Allocator>, |
65 | boost::serialization::stl::archive_input_unordered_set< |
66 | Archive, |
67 | boost::unordered_set<Key, HashFcn, EqualKey, Allocator> |
68 | > |
69 | >(ar, t); |
70 | } |
71 | |
72 | // split non-intrusive serialization function member into separate |
73 | // non intrusive save/load member functions |
74 | template< |
75 | class Archive, |
76 | class Key, |
77 | class HashFcn, |
78 | class EqualKey, |
79 | class Allocator |
80 | > |
81 | inline void serialize( |
82 | Archive & ar, |
83 | boost::unordered_set<Key, HashFcn, EqualKey, Allocator> &t, |
84 | const unsigned int file_version |
85 | ){ |
86 | boost::serialization::split_free(ar, t, file_version); |
87 | } |
88 | |
89 | // unordered_multiset |
90 | template< |
91 | class Archive, |
92 | class Key, |
93 | class HashFcn, |
94 | class EqualKey, |
95 | class Allocator |
96 | > |
97 | inline void save( |
98 | Archive & ar, |
99 | const boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> &t, |
100 | const unsigned int /*file_version*/ |
101 | ){ |
102 | boost::serialization::stl::save_unordered_collection< |
103 | Archive, |
104 | boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> |
105 | >(ar, t); |
106 | } |
107 | |
108 | template< |
109 | class Archive, |
110 | class Key, |
111 | class HashFcn, |
112 | class EqualKey, |
113 | class Allocator |
114 | > |
115 | inline void load( |
116 | Archive & ar, |
117 | boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> &t, |
118 | const unsigned int /*file_version*/ |
119 | ){ |
120 | boost::serialization::stl::load_unordered_collection< |
121 | Archive, |
122 | boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator>, |
123 | boost::serialization::stl::archive_input_unordered_multiset< |
124 | Archive, |
125 | boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> |
126 | > |
127 | >(ar, t); |
128 | } |
129 | |
130 | // split non-intrusive serialization function member into separate |
131 | // non intrusive save/load member functions |
132 | template< |
133 | class Archive, |
134 | class Key, |
135 | class HashFcn, |
136 | class EqualKey, |
137 | class Allocator |
138 | > |
139 | inline void serialize( |
140 | Archive & ar, |
141 | boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> &t, |
142 | const unsigned int file_version |
143 | ){ |
144 | boost::serialization::split_free(ar, t, file_version); |
145 | } |
146 | |
147 | } // namespace serialization |
148 | } // namespace boost |
149 | |
150 | #endif // BOOST_SERIALIZATION_BOOST_UNORDERED_SET_HPP |
151 | |