source: NonGTP/Boost/boost/serialization/deque.hpp @ 857

Revision 857, 2.4 KB checked in by igarcia, 18 years ago (diff)
Line 
1#ifndef  BOOST_SERIALIZATION_DEQUE_HPP
2#define BOOST_SERIALIZATION_DEQUE_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// deque.hpp
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 <deque>
20
21#include <boost/config.hpp>
22
23#include <boost/serialization/collections_save_imp.hpp>
24#include <boost/serialization/collections_load_imp.hpp>
25#include <boost/serialization/split_free.hpp>
26
27// function specializations must be defined in the appropriate
28// namespace - boost::serialization
29#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
30#define STD _STLP_STD
31#else
32#define STD std
33#endif
34
35namespace boost {
36namespace serialization {
37
38template<class Archive, class U, class Allocator>
39inline void save(
40    Archive & ar,
41    const STD::deque<U, Allocator> &t,
42    const unsigned int /* file_version */
43){
44    boost::serialization::stl::save_collection<
45        Archive, STD::deque<U, Allocator>
46    >(ar, t);
47}
48
49template<class Archive, class U, class Allocator>
50inline void load(
51    Archive & ar,
52    STD::deque<U, Allocator> &t,
53    const unsigned int file_version
54){
55    boost::serialization::stl::load_collection<
56        Archive,
57        STD::deque<U, Allocator>,
58        boost::serialization::stl::archive_input_seq<
59            Archive, STD::deque<U, Allocator>
60        >,
61        boost::serialization::stl::no_reserve_imp<STD::deque<U, Allocator> >
62    >(ar, t);
63}
64
65// split non-intrusive serialization function member into separate
66// non intrusive save/load member functions
67template<class Archive, class U, class Allocator>
68inline void serialize(
69    Archive & ar,
70    STD::deque<U, Allocator> &t,
71    const unsigned int file_version
72){
73    boost::serialization::split_free(ar, t, file_version);
74}
75
76} // namespace serialization
77} // namespace boost
78
79#include <boost/serialization/collection_traits.hpp>
80
81BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::deque)
82
83#undef STD
84
85#endif // BOOST_SERIALIZATION_DEQUE_HPP
Note: See TracBrowser for help on using the repository browser.