comparison DEPENDENCIES/generic/include/boost/archive/binary_iarchive.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 #ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
2 #define BOOST_ARCHIVE_BINARY_IARCHIVE_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 // binary_iarchive.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 <istream>
20 #include <boost/archive/binary_iarchive_impl.hpp>
21 #include <boost/archive/detail/register_archive.hpp>
22
23 #ifdef BOOST_MSVC
24 # pragma warning(push)
25 # pragma warning(disable : 4511 4512)
26 #endif
27
28 namespace boost {
29 namespace archive {
30
31 // do not derive from the classes below. If you want to extend this functionality
32 // via inhertance, derived from text_iarchive_impl instead. This will
33 // preserve correct static polymorphism.
34
35 // same as binary_iarchive below - without the shared_ptr_helper
36 class naked_binary_iarchive :
37 public binary_iarchive_impl<
38 boost::archive::naked_binary_iarchive,
39 std::istream::char_type,
40 std::istream::traits_type
41 >
42 {
43 public:
44 naked_binary_iarchive(std::istream & is, unsigned int flags = 0) :
45 binary_iarchive_impl<
46 naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
47 >(is, flags)
48 {}
49 naked_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
50 binary_iarchive_impl<
51 naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
52 >(bsb, flags)
53 {}
54 };
55
56 } // namespace archive
57 } // namespace boost
58
59 // note special treatment of shared_ptr. This type needs a special
60 // structure associated with every archive. We created a "mix-in"
61 // class to provide this functionality. Since shared_ptr holds a
62 // special esteem in the boost library - we included it here by default.
63 #include <boost/archive/shared_ptr_helper.hpp>
64
65 namespace boost {
66 namespace archive {
67
68 // do not derive from this class. If you want to extend this functionality
69 // via inhertance, derived from binary_iarchive_impl instead. This will
70 // preserve correct static polymorphism.
71 class binary_iarchive :
72 public binary_iarchive_impl<
73 boost::archive::binary_iarchive,
74 std::istream::char_type,
75 std::istream::traits_type
76 >,
77 public detail::shared_ptr_helper
78 {
79 public:
80 binary_iarchive(std::istream & is, unsigned int flags = 0) :
81 binary_iarchive_impl<
82 binary_iarchive, std::istream::char_type, std::istream::traits_type
83 >(is, flags)
84 {}
85 binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
86 binary_iarchive_impl<
87 binary_iarchive, std::istream::char_type, std::istream::traits_type
88 >(bsb, flags)
89 {}
90 };
91
92 } // namespace archive
93 } // namespace boost
94
95 // required by export
96 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive)
97 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive)
98
99 #ifdef BOOST_MSVC
100 #pragma warning(pop)
101 #endif
102
103 #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP