]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/serialization/include/boost/archive/detail/polymorphic_iarchive_route.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / serialization / include / boost / archive / detail / polymorphic_iarchive_route.hpp
CommitLineData
7c673cae
FG
1#ifndef BOOST_ARCHIVE_DETAIL_POLYMORPHIC_IARCHIVE_ROUTE_HPP
2#define BOOST_ARCHIVE_DETAIL_POLYMORPHIC_IARCHIVE_ROUTE_HPP
3
4// MS compatible compilers support #pragma once
5#if defined(_MSC_VER)
6# pragma once
7#endif
8
9/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10// polymorphic_iarchive_route.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 <string>
20#include <ostream>
21#include <cstddef>
22
23#include <boost/config.hpp>
24#if defined(BOOST_NO_STDC_NAMESPACE)
25namespace std{
26 using ::size_t;
27} // namespace std
28#endif
29
30#include <boost/cstdint.hpp>
31#include <boost/integer_traits.hpp>
32#include <boost/archive/polymorphic_iarchive.hpp>
33#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
34
35namespace boost {
36namespace serialization {
37 class extended_type_info;
38} // namespace serialization
39namespace archive {
40namespace detail{
41
42class basic_iserializer;
43class basic_pointer_iserializer;
44
45#ifdef BOOST_MSVC
46# pragma warning(push)
47# pragma warning(disable : 4511 4512)
48#endif
49
50template<class ArchiveImplementation>
51class polymorphic_iarchive_route :
52 public polymorphic_iarchive,
53 // note: gcc dynamic cross cast fails if the the derivation below is
54 // not public. I think this is a mistake.
55 public /*protected*/ ArchiveImplementation
56{
57private:
58 // these are used by the serialization library.
59 virtual void load_object(
60 void *t,
61 const basic_iserializer & bis
62 ){
63 ArchiveImplementation::load_object(t, bis);
64 }
65 virtual const basic_pointer_iserializer * load_pointer(
66 void * & t,
67 const basic_pointer_iserializer * bpis_ptr,
68 const basic_pointer_iserializer * (*finder)(
69 const boost::serialization::extended_type_info & type
70 )
71 ){
72 return ArchiveImplementation::load_pointer(t, bpis_ptr, finder);
73 }
74 virtual void set_library_version(library_version_type archive_library_version){
75 ArchiveImplementation::set_library_version(archive_library_version);
76 }
77 virtual library_version_type get_library_version() const{
78 return ArchiveImplementation::get_library_version();
79 }
80 virtual unsigned int get_flags() const {
81 return ArchiveImplementation::get_flags();
82 }
83 virtual void delete_created_pointers(){
84 ArchiveImplementation::delete_created_pointers();
85 }
86 virtual void reset_object_address(
87 const void * new_address,
88 const void * old_address
89 ){
90 ArchiveImplementation::reset_object_address(new_address, old_address);
91 }
92 virtual void load_binary(void * t, std::size_t size){
93 ArchiveImplementation::load_binary(t, size);
94 }
95 // primitive types the only ones permitted by polymorphic archives
96 virtual void load(bool & t){
97 ArchiveImplementation::load(t);
98 }
99 virtual void load(char & t){
100 ArchiveImplementation::load(t);
101 }
102 virtual void load(signed char & t){
103 ArchiveImplementation::load(t);
104 }
105 virtual void load(unsigned char & t){
106 ArchiveImplementation::load(t);
107 }
108 #ifndef BOOST_NO_CWCHAR
109 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
110 virtual void load(wchar_t & t){
111 ArchiveImplementation::load(t);
112 }
113 #endif
114 #endif
115 virtual void load(short & t){
116 ArchiveImplementation::load(t);
117 }
118 virtual void load(unsigned short & t){
119 ArchiveImplementation::load(t);
120 }
121 virtual void load(int & t){
122 ArchiveImplementation::load(t);
123 }
124 virtual void load(unsigned int & t){
125 ArchiveImplementation::load(t);
126 }
127 virtual void load(long & t){
128 ArchiveImplementation::load(t);
129 }
130 virtual void load(unsigned long & t){
131 ArchiveImplementation::load(t);
132 }
133 #if defined(BOOST_HAS_LONG_LONG)
134 virtual void load(boost::long_long_type & t){
135 ArchiveImplementation::load(t);
136 }
137 virtual void load(boost::ulong_long_type & t){
138 ArchiveImplementation::load(t);
139 }
140 #elif defined(BOOST_HAS_MS_INT64)
141 virtual void load(__int64 & t){
142 ArchiveImplementation::load(t);
143 }
144 virtual void load(unsigned __int64 & t){
145 ArchiveImplementation::load(t);
146 }
147 #endif
148 virtual void load(float & t){
149 ArchiveImplementation::load(t);
150 }
151 virtual void load(double & t){
152 ArchiveImplementation::load(t);
153 }
154 virtual void load(std::string & t){
155 ArchiveImplementation::load(t);
156 }
157 #ifndef BOOST_NO_STD_WSTRING
158 virtual void load(std::wstring & t){
159 ArchiveImplementation::load(t);
160 }
161 #endif
162 // used for xml and other tagged formats default does nothing
163 virtual void load_start(const char * name){
164 ArchiveImplementation::load_start(name);
165 }
166 virtual void load_end(const char * name){
167 ArchiveImplementation::load_end(name);
168 }
169 virtual void register_basic_serializer(const basic_iserializer & bis){
170 ArchiveImplementation::register_basic_serializer(bis);
171 }
172 virtual helper_collection &
173 get_helper_collection(){
174 return ArchiveImplementation::get_helper_collection();
175 }
176public:
177 // this can't be inheriteded because they appear in mulitple
178 // parents
179 typedef mpl::bool_<true> is_loading;
180 typedef mpl::bool_<false> is_saving;
181 // the >> operator
182 template<class T>
183 polymorphic_iarchive & operator>>(T & t){
184 return polymorphic_iarchive::operator>>(t);
185 }
186 // the & operator
187 template<class T>
188 polymorphic_iarchive & operator&(T & t){
189 return polymorphic_iarchive::operator&(t);
190 }
191 // register type function
192 template<class T>
193 const basic_pointer_iserializer *
194 register_type(T * t = NULL){
195 return ArchiveImplementation::register_type(t);
196 }
197 // all current archives take a stream as constructor argument
198 template <class _Elem, class _Tr>
199 polymorphic_iarchive_route(
200 std::basic_istream<_Elem, _Tr> & is,
201 unsigned int flags = 0
202 ) :
203 ArchiveImplementation(is, flags)
204 {}
205 virtual ~polymorphic_iarchive_route(){};
206};
207
208} // namespace detail
209} // namespace archive
210} // namespace boost
211
212#ifdef BOOST_MSVC
213#pragma warning(pop)
214#endif
215
216#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
217
218#endif // BOOST_ARCHIVE_DETAIL_POLYMORPHIC_IARCHIVE_DISPATCH_HPP