fix doc example typo
[boost.git] / boost / archive / binary_iarchive.hpp
bloba43df2112a212d2203cd3e6827368ddefb7a8643
1 #ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
2 #define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
6 # pragma once
7 #endif
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // binary_iarchive.hpp
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)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <istream>
20 #include <boost/archive/binary_iarchive_impl.hpp>
22 namespace boost {
23 namespace archive {
25 // do not derive from the classes below. If you want to extend this functionality
26 // via inhertance, derived from text_iarchive_impl instead. This will
27 // preserve correct static polymorphism.
29 // same as binary_iarchive below - without the shared_ptr_helper
30 class naked_binary_iarchive :
31 public binary_iarchive_impl<
32 boost::archive::naked_binary_iarchive,
33 std::istream::char_type,
34 std::istream::traits_type
37 public:
38 naked_binary_iarchive(std::istream & is, unsigned int flags = 0) :
39 binary_iarchive_impl<
40 naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
41 >(is, flags)
43 naked_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
44 binary_iarchive_impl<
45 naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
46 >(bsb, flags)
50 } // namespace archive
51 } // namespace boost
53 // note special treatment of shared_ptr. This type needs a special
54 // structure associated with every archive. We created a "mix-in"
55 // class to provide this functionality. Since shared_ptr holds a
56 // special esteem in the boost library - we included it here by default.
57 #include <boost/archive/shared_ptr_helper.hpp>
59 namespace boost {
60 namespace archive {
62 // do not derive from this class. If you want to extend this functionality
63 // via inhertance, derived from binary_iarchive_impl instead. This will
64 // preserve correct static polymorphism.
65 class binary_iarchive :
66 public binary_iarchive_impl<
67 boost::archive::binary_iarchive,
68 std::istream::char_type,
69 std::istream::traits_type
71 public detail::shared_ptr_helper
73 public:
74 binary_iarchive(std::istream & is, unsigned int flags = 0) :
75 binary_iarchive_impl<
76 binary_iarchive, std::istream::char_type, std::istream::traits_type
77 >(is, flags)
79 binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
80 binary_iarchive_impl<
81 binary_iarchive, std::istream::char_type, std::istream::traits_type
82 >(bsb, flags)
86 } // namespace archive
87 } // namespace boost
89 // required by export
90 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive)
91 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive)
93 #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP