Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/serialization/hash_map.hpp @ 33

Last change on this file since 33 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 4.3 KB
Line 
1#ifndef  BOOST_SERIALIZATION_HASH_MAP_HPP
2#define BOOST_SERIALIZATION_HASH_MAP_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// serialization/hash_map.hpp:
11// serialization for stl hash_map templates
12
13// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
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#ifdef BOOST_HAS_HASH
22#include BOOST_HASH_MAP_HEADER
23
24#include <boost/serialization/utility.hpp>
25#include <boost/serialization/hash_collections_save_imp.hpp>
26#include <boost/serialization/hash_collections_load_imp.hpp>
27#include <boost/serialization/split_free.hpp>
28
29namespace boost { 
30namespace serialization {
31
32template<
33    class Archive, 
34    class Key, 
35    class HashFcn, 
36    class EqualKey,
37    class Allocator
38>
39inline void save(
40    Archive & ar,
41    const BOOST_STD_EXTENSION_NAMESPACE::hash_map<
42        Key, HashFcn, EqualKey, Allocator
43    > &t,
44    const unsigned int file_version
45){
46    boost::serialization::stl::save_hash_collection<
47        Archive, 
48        BOOST_STD_EXTENSION_NAMESPACE::hash_map<
49            Key, HashFcn, EqualKey, Allocator
50        >
51    >(ar, t);
52}
53
54template<
55    class Archive, 
56    class Key, 
57    class HashFcn, 
58    class EqualKey,
59    class Allocator
60>
61inline void load(
62    Archive & ar,
63    BOOST_STD_EXTENSION_NAMESPACE::hash_map<
64        Key, HashFcn, EqualKey, Allocator
65    > &t,
66    const unsigned int file_version
67){
68    boost::serialization::stl::load_hash_collection<
69        Archive,
70        BOOST_STD_EXTENSION_NAMESPACE::hash_map<
71            Key, HashFcn, EqualKey, Allocator
72        >,
73        boost::serialization::stl::archive_input_unique<
74            Archive, 
75            BOOST_STD_EXTENSION_NAMESPACE::hash_map<
76                Key, HashFcn, EqualKey, Allocator
77            >
78        >
79    >(ar, t);
80}
81
82// split non-intrusive serialization function member into separate
83// non intrusive save/load member functions
84template<
85    class Archive, 
86    class Key, 
87    class HashFcn, 
88    class EqualKey,
89    class Allocator
90>
91inline void serialize(
92    Archive & ar,
93    BOOST_STD_EXTENSION_NAMESPACE::hash_map<
94        Key, HashFcn, EqualKey, Allocator
95    > &t,
96    const unsigned int file_version
97){
98    boost::serialization::split_free(ar, t, file_version);
99}
100
101// hash_multimap
102template<
103    class Archive, 
104    class Key, 
105    class HashFcn, 
106    class EqualKey,
107    class Allocator
108>
109inline void save(
110    Archive & ar,
111    const BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
112        Key, HashFcn, EqualKey, Allocator
113    > &t,
114    const unsigned int file_version
115){
116    boost::serialization::stl::save_hash_collection<
117        Archive, 
118        BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
119            Key, HashFcn, EqualKey, Allocator
120        >
121    >(ar, t);
122}
123
124template<
125    class Archive, 
126    class Key, 
127    class HashFcn, 
128    class EqualKey,
129    class Allocator
130>
131inline void load(
132    Archive & ar,
133    BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
134        Key, HashFcn, EqualKey, Allocator
135    > &t,
136    const unsigned int file_version
137){
138    boost::serialization::stl::load_hash_collection<
139        Archive,
140        BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
141            Key, HashFcn, EqualKey, Allocator
142        >,
143        boost::serialization::stl::archive_input_multi<
144            Archive, 
145            BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
146                Key, HashFcn, EqualKey, Allocator
147            >
148        >
149    >(ar, t);
150}
151
152// split non-intrusive serialization function member into separate
153// non intrusive save/load member functions
154template<
155    class Archive, 
156    class Key, 
157    class HashFcn, 
158    class EqualKey,
159    class Allocator
160>
161inline void serialize(
162    Archive & ar,
163    BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
164        Key, HashFcn, EqualKey, Allocator
165    > &t,
166    const unsigned int file_version
167){
168    boost::serialization::split_free(ar, t, file_version);
169}
170
171} // namespace serialization
172} // namespace boost
173
174#endif // BOOST_HAS_HASH
175#endif // BOOST_SERIALIZATION_HASH_MAP_HPP
Note: See TracBrowser for help on using the repository browser.