williamr@2
|
1 |
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
|
williamr@2
|
2 |
#define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
|
williamr@2
|
3 |
|
williamr@2
|
4 |
// MS compatible compilers support #pragma once
|
williamr@2
|
5 |
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
williamr@2
|
6 |
# pragma once
|
williamr@2
|
7 |
#endif
|
williamr@2
|
8 |
|
williamr@2
|
9 |
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
williamr@2
|
10 |
// basic_iarchive.hpp:
|
williamr@2
|
11 |
|
williamr@2
|
12 |
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
williamr@2
|
13 |
// Use, modification and distribution is subject to the Boost Software
|
williamr@2
|
14 |
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
williamr@2
|
15 |
// http://www.boost.org/LICENSE_1_0.txt)
|
williamr@2
|
16 |
|
williamr@2
|
17 |
// See http://www.boost.org for updates, documentation, and revision history.
|
williamr@2
|
18 |
|
williamr@2
|
19 |
// can't use this - much as I'd like to as borland doesn't support it
|
williamr@2
|
20 |
// #include <boost/scoped_ptr.hpp>
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <boost/config.hpp>
|
williamr@2
|
23 |
#include <boost/archive/basic_archive.hpp>
|
williamr@2
|
24 |
#include <boost/serialization/tracking_enum.hpp>
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
williamr@2
|
27 |
|
williamr@2
|
28 |
namespace boost {
|
williamr@2
|
29 |
template<class T>
|
williamr@2
|
30 |
class shared_ptr;
|
williamr@2
|
31 |
|
williamr@2
|
32 |
namespace serialization {
|
williamr@2
|
33 |
class extended_type_info;
|
williamr@2
|
34 |
} // namespace serialization
|
williamr@2
|
35 |
|
williamr@2
|
36 |
namespace archive {
|
williamr@2
|
37 |
namespace detail {
|
williamr@2
|
38 |
|
williamr@2
|
39 |
class basic_iarchive_impl;
|
williamr@2
|
40 |
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
|
williamr@2
|
41 |
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
|
williamr@2
|
42 |
//////////////////////////////////////////////////////////////////////
|
williamr@2
|
43 |
// class basic_iarchive - read serialized objects from a input stream
|
williamr@2
|
44 |
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive
|
williamr@2
|
45 |
{
|
williamr@2
|
46 |
friend class basic_iarchive_impl;
|
williamr@2
|
47 |
// hide implementation of this class to minimize header conclusion
|
williamr@2
|
48 |
// in client code. I couldn't used scoped pointer with borland
|
williamr@2
|
49 |
// boost::scoped_ptr<basic_iarchive_impl> pimpl;
|
williamr@2
|
50 |
basic_iarchive_impl * pimpl;
|
williamr@2
|
51 |
|
williamr@2
|
52 |
virtual void vload(version_type &t) = 0;
|
williamr@2
|
53 |
virtual void vload(object_id_type &t) = 0;
|
williamr@2
|
54 |
virtual void vload(class_id_type &t) = 0;
|
williamr@2
|
55 |
virtual void vload(class_id_optional_type &t) = 0;
|
williamr@2
|
56 |
virtual void vload(class_name_type &t) = 0;
|
williamr@2
|
57 |
virtual void vload(tracking_type &t) = 0;
|
williamr@2
|
58 |
protected:
|
williamr@2
|
59 |
basic_iarchive(unsigned int flags);
|
williamr@2
|
60 |
// account for bogus gcc warning
|
williamr@2
|
61 |
#if defined(__GNUC__)
|
williamr@2
|
62 |
virtual
|
williamr@2
|
63 |
#endif
|
williamr@2
|
64 |
~basic_iarchive();
|
williamr@2
|
65 |
public:
|
williamr@2
|
66 |
// note: NOT part of the public API.
|
williamr@2
|
67 |
void next_object_pointer(void *t);
|
williamr@2
|
68 |
void register_basic_serializer(const basic_iserializer & bis);
|
williamr@2
|
69 |
void
|
williamr@2
|
70 |
lookup_basic_helper(
|
williamr@2
|
71 |
const boost::serialization::extended_type_info * const eti,
|
williamr@2
|
72 |
shared_ptr<void> & sph
|
williamr@2
|
73 |
);
|
williamr@2
|
74 |
void
|
williamr@2
|
75 |
insert_basic_helper(
|
williamr@2
|
76 |
const boost::serialization::extended_type_info * const eti,
|
williamr@2
|
77 |
shared_ptr<void> & sph
|
williamr@2
|
78 |
);
|
williamr@2
|
79 |
void load_object(
|
williamr@2
|
80 |
void *t,
|
williamr@2
|
81 |
const basic_iserializer & bis
|
williamr@2
|
82 |
);
|
williamr@2
|
83 |
const basic_pointer_iserializer *
|
williamr@2
|
84 |
load_pointer(
|
williamr@2
|
85 |
void * & t,
|
williamr@2
|
86 |
const basic_pointer_iserializer * bpis_ptr,
|
williamr@2
|
87 |
const basic_pointer_iserializer * (*finder)(
|
williamr@2
|
88 |
const boost::serialization::extended_type_info & eti
|
williamr@2
|
89 |
)
|
williamr@2
|
90 |
);
|
williamr@2
|
91 |
// real public API starts here
|
williamr@2
|
92 |
void
|
williamr@2
|
93 |
set_library_version(unsigned int archive_library_version);
|
williamr@2
|
94 |
unsigned int
|
williamr@2
|
95 |
get_library_version() const;
|
williamr@2
|
96 |
unsigned int
|
williamr@2
|
97 |
get_flags() const;
|
williamr@2
|
98 |
void
|
williamr@2
|
99 |
reset_object_address(const void * new_address, const void * old_address);
|
williamr@2
|
100 |
void
|
williamr@2
|
101 |
delete_created_pointers();
|
williamr@2
|
102 |
};
|
williamr@2
|
103 |
|
williamr@2
|
104 |
} // namespace detail
|
williamr@2
|
105 |
} // namespace archive
|
williamr@2
|
106 |
} // namespace boost
|
williamr@2
|
107 |
|
williamr@2
|
108 |
// required by smart_cast for compilers not implementing
|
williamr@2
|
109 |
// partial template specialization
|
williamr@2
|
110 |
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(
|
williamr@2
|
111 |
boost::archive::detail::basic_iarchive
|
williamr@2
|
112 |
)
|
williamr@2
|
113 |
|
williamr@2
|
114 |
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
williamr@2
|
115 |
|
williamr@2
|
116 |
#endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
|