comparison DEPENDENCIES/generic/include/boost/archive/text_iarchive.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
1 #ifndef BOOST_ARCHIVE_TEXT_IARCHIVE_HPP 1 #ifndef BOOST_ARCHIVE_TEXT_IARCHIVE_HPP
2 #define BOOST_ARCHIVE_TEXT_IARCHIVE_HPP 2 #define BOOST_ARCHIVE_TEXT_IARCHIVE_HPP
3 3
4 // MS compatible compilers support #pragma once 4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020) 5 #if defined(_MSC_VER)
6 # pragma once 6 # pragma once
7 #endif 7 #endif
8 8
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // text_iarchive.hpp 10 // text_iarchive.hpp
33 #endif 33 #endif
34 34
35 namespace boost { 35 namespace boost {
36 namespace archive { 36 namespace archive {
37 37
38 namespace detail {
39 template<class Archive> class interface_iarchive;
40 } // namespace detail
41
38 template<class Archive> 42 template<class Archive>
39 class text_iarchive_impl : 43 class text_iarchive_impl :
40 public basic_text_iprimitive<std::istream>, 44 public basic_text_iprimitive<std::istream>,
41 public basic_text_iarchive<Archive> 45 public basic_text_iarchive<Archive>
42 { 46 {
43 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS 47 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
44 public: 48 public:
45 #else 49 #else
46 friend class detail::interface_iarchive<Archive>;
47 friend class basic_text_iarchive<Archive>;
48 friend class load_access;
49 protected: 50 protected:
51 #if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
52 // for some inexplicable reason insertion of "class" generates compile erro
53 // on msvc 7.1
54 friend detail::interface_iarchive<Archive>;
55 friend load_access;
56 #else
57 friend class detail::interface_iarchive<Archive>;
58 friend class load_access;
59 #endif
50 #endif 60 #endif
51 template<class T> 61 template<class T>
52 void load(T & t){ 62 void load(T & t){
53 basic_text_iprimitive<std::istream>::load(t); 63 basic_text_iprimitive<std::istream>::load(t);
54 } 64 }
90 // don't import inline definitions! leave this as a reminder. 100 // don't import inline definitions! leave this as a reminder.
91 //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) 101 //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
92 ~text_iarchive_impl(){}; 102 ~text_iarchive_impl(){};
93 }; 103 };
94 104
95 // do not derive from the classes below. If you want to extend this functionality
96 // via inhertance, derived from text_iarchive_impl instead. This will
97 // preserve correct static polymorphism.
98
99 // same as text_iarchive below - without the shared_ptr_helper
100 class naked_text_iarchive :
101 public text_iarchive_impl<naked_text_iarchive>
102 {
103 public:
104 naked_text_iarchive(std::istream & is_, unsigned int flags = 0) :
105 // note: added _ to suppress useless gcc warning
106 text_iarchive_impl<naked_text_iarchive>(is_, flags)
107 {}
108 ~naked_text_iarchive(){}
109 };
110
111 } // namespace archive 105 } // namespace archive
112 } // namespace boost 106 } // namespace boost
113 107
114 #ifdef BOOST_MSVC 108 #ifdef BOOST_MSVC
115 #pragma warning(pop) 109 #pragma warning(pop)
116 #endif 110 #endif
117 111
118 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas 112 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
119
120 // note special treatment of shared_ptr. This type needs a special
121 // structure associated with every archive. We created a "mix-in"
122 // class to provide this functionality. Since shared_ptr holds a
123 // special esteem in the boost library - we included it here by default.
124 #include <boost/archive/shared_ptr_helper.hpp>
125 113
126 #ifdef BOOST_MSVC 114 #ifdef BOOST_MSVC
127 # pragma warning(push) 115 # pragma warning(push)
128 # pragma warning(disable : 4511 4512) 116 # pragma warning(disable : 4511 4512)
129 #endif 117 #endif
130 118
131 namespace boost { 119 namespace boost {
132 namespace archive { 120 namespace archive {
133 121
134 class text_iarchive : 122 class text_iarchive :
135 public text_iarchive_impl<text_iarchive>, 123 public text_iarchive_impl<text_iarchive>{
136 public detail::shared_ptr_helper
137 {
138 public: 124 public:
139 text_iarchive(std::istream & is_, unsigned int flags = 0) : 125 text_iarchive(std::istream & is_, unsigned int flags = 0) :
140 // note: added _ to suppress useless gcc warning 126 // note: added _ to suppress useless gcc warning
141 text_iarchive_impl<text_iarchive>(is_, flags) 127 text_iarchive_impl<text_iarchive>(is_, flags)
142 {} 128 {}