Chris@16
|
1 //
|
Chris@16
|
2 // Boost.Pointer Container
|
Chris@16
|
3 //
|
Chris@16
|
4 // Copyright Thorsten Ottosen 2008. Use, modification and
|
Chris@16
|
5 // distribution is subject to the Boost Software License, Version
|
Chris@16
|
6 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8 //
|
Chris@16
|
9 // For more information, see http://www.boost.org/libs/ptr_container/
|
Chris@16
|
10 //
|
Chris@16
|
11
|
Chris@16
|
12 #ifndef BOOST_PTR_CONTAINER_SERIALIZE_PTR_CIRCULAR_BUFFER_HPP
|
Chris@16
|
13 #define BOOST_PTR_CONTAINER_SERIALIZE_PTR_CIRCULAR_BUFFER_HPP
|
Chris@16
|
14
|
Chris@16
|
15 #include <boost/ptr_container/detail/serialize_reversible_cont.hpp>
|
Chris@16
|
16 #include <boost/ptr_container/ptr_circular_buffer.hpp>
|
Chris@16
|
17
|
Chris@16
|
18 namespace boost
|
Chris@16
|
19 {
|
Chris@16
|
20
|
Chris@16
|
21 namespace serialization
|
Chris@16
|
22 {
|
Chris@16
|
23
|
Chris@16
|
24 template<class Archive, class T, class CloneAllocator, class Allocator>
|
Chris@16
|
25 void load(Archive& ar, ptr_circular_buffer<T, CloneAllocator, Allocator>& c, unsigned int version)
|
Chris@16
|
26 {
|
Chris@16
|
27 typedef ptr_circular_buffer<T, CloneAllocator, Allocator> container_type;
|
Chris@16
|
28 typedef BOOST_DEDUCED_TYPENAME container_type::size_type size_type;
|
Chris@16
|
29
|
Chris@16
|
30 size_type n;
|
Chris@16
|
31 ar >> boost::serialization::make_nvp( ptr_container_detail::count(), n );
|
Chris@16
|
32 c.reserve(n);
|
Chris@16
|
33
|
Chris@16
|
34 ptr_container_detail::load_helper(ar, c, n);
|
Chris@16
|
35 }
|
Chris@16
|
36
|
Chris@16
|
37 template<class Archive, class T, class CloneAllocator, class Allocator>
|
Chris@16
|
38 void serialize(Archive& ar, ptr_circular_buffer<T, CloneAllocator, Allocator>& c, const unsigned int version)
|
Chris@16
|
39 {
|
Chris@16
|
40 split_free(ar, c, version);
|
Chris@16
|
41 }
|
Chris@16
|
42
|
Chris@16
|
43 } // namespace serialization
|
Chris@16
|
44 } // namespace boost
|
Chris@16
|
45
|
Chris@16
|
46 #endif
|