-
Notifications
You must be signed in to change notification settings - Fork 11
/
serialization_unordered_map.h
77 lines (61 loc) · 2.81 KB
/
serialization_unordered_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* Copyright © 2001-2014, Hove and/or its affiliates. All rights reserved.
This file is part of Navitia,
the software to build cool stuff with public transport.
Hope you'll enjoy and contribute to this project,
powered by Hove (www.hove.com).
Help us simplify mobility and open public transport:
a non ending quest to the responsive locomotion way of traveling!
LICENCE: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Stay tuned using
twitter @navitia
IRC #navitia on freenode
https://groups.google.com/d/forum/navitia
www.navitia.io
*/
// from boost/serialization/map.hpp with the following copyright:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#if BOOST_VERSION >= 105700
#include <boost/serialization/unordered_map.hpp>
#else
#include <boost/serialization/utility.hpp>
#include <boost/serialization/collections_save_imp.hpp>
#include <boost/serialization/collections_load_imp.hpp>
#include <boost/serialization/split_free.hpp>
#include <unordered_map>
namespace boost {
namespace serialization {
template <class Archive, class... Types>
inline void save(Archive& ar, const std::unordered_map<Types...>& t, const unsigned int /* file_version */
) {
boost::serialization::stl::save_collection<Archive, std::unordered_map<Types...> >(ar, t);
}
template <class Archive, class... Types>
inline void load(Archive& ar, std::unordered_map<Types...>& t, const unsigned int /* file_version */
) {
boost::serialization::stl::load_collection<
Archive, std::unordered_map<Types...>,
boost::serialization::stl::archive_input_map<Archive, std::unordered_map<Types...> >,
boost::serialization::stl::reserve_imp<std::unordered_map<Types...> > >(ar, t);
}
// split non-intrusive serialization function member into separate
// non intrusive save/load member functions
template <class Archive, class... Types>
inline void serialize(Archive& ar, std::unordered_map<Types...>& t, const unsigned int file_version) {
boost::serialization::split_free(ar, t, file_version);
}
} // namespace serialization
} // namespace boost
#endif