1 | #ifndef BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP |
---|
2 | #define BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_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 | // basic_iserializer.hpp: extenstion of type_info required for serialization. |
---|
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 <cassert> |
---|
20 | #include <cstdlib> // NULL |
---|
21 | #include <boost/config.hpp> |
---|
22 | |
---|
23 | #include <boost/archive/detail/auto_link_archive.hpp> |
---|
24 | #include <boost/archive/detail/basic_serializer.hpp> |
---|
25 | |
---|
26 | #include <boost/archive/detail/abi_prefix.hpp> // must be the last header |
---|
27 | |
---|
28 | namespace boost { |
---|
29 | |
---|
30 | namespace serialization { |
---|
31 | class extended_type_info; |
---|
32 | } // namespace serialization |
---|
33 | |
---|
34 | // forward declarations |
---|
35 | namespace archive { |
---|
36 | namespace detail { |
---|
37 | |
---|
38 | class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; |
---|
39 | class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; |
---|
40 | |
---|
41 | class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer : |
---|
42 | public basic_serializer |
---|
43 | { |
---|
44 | private: |
---|
45 | basic_pointer_iserializer *bpis; |
---|
46 | protected: |
---|
47 | explicit basic_iserializer( |
---|
48 | const boost::serialization::extended_type_info & type_ |
---|
49 | ); |
---|
50 | // account for bogus gcc warning |
---|
51 | #if defined(__GNUC__) |
---|
52 | virtual |
---|
53 | #endif |
---|
54 | ~basic_iserializer(); |
---|
55 | public: |
---|
56 | bool serialized_as_pointer() const { |
---|
57 | return bpis != NULL; |
---|
58 | } |
---|
59 | void set_bpis(basic_pointer_iserializer *bpis_){ |
---|
60 | bpis = bpis_; |
---|
61 | } |
---|
62 | const basic_pointer_iserializer * get_bpis_ptr() const { |
---|
63 | return bpis; |
---|
64 | } |
---|
65 | virtual void load_object_data( |
---|
66 | basic_iarchive & ar, |
---|
67 | void *x, |
---|
68 | const unsigned int file_version |
---|
69 | ) const = 0; |
---|
70 | // returns true if class_info should be saved |
---|
71 | virtual bool class_info() const = 0 ; |
---|
72 | // returns true if objects should be tracked |
---|
73 | virtual bool tracking(const unsigned int) const = 0 ; |
---|
74 | // returns class version |
---|
75 | virtual unsigned int version() const = 0 ; |
---|
76 | // returns true if this class is polymorphic |
---|
77 | virtual bool is_polymorphic() const = 0; |
---|
78 | virtual void destroy(/*const*/ void *address) const = 0 ; |
---|
79 | }; |
---|
80 | |
---|
81 | } // namespae detail |
---|
82 | } // namespace archive |
---|
83 | } // namespace boost |
---|
84 | |
---|
85 | #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas |
---|
86 | |
---|
87 | #endif // BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP |
---|