Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / archive / polymorphic_iarchive.hpp @ 2486

History | View | Annotate | Download (5 kB)

1 2486 sjacqu01
#ifndef BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP
2 2486 sjacqu01
#define BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP
3 2486 sjacqu01
4 2486 sjacqu01
// MS compatible compilers support #pragma once
5 2486 sjacqu01
#if defined(_MSC_VER)
6 2486 sjacqu01
# pragma once
7 2486 sjacqu01
#endif
8 2486 sjacqu01
9 2486 sjacqu01
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 2486 sjacqu01
// polymorphic_iarchive.hpp
11 2486 sjacqu01
12 2486 sjacqu01
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 2486 sjacqu01
// Use, modification and distribution is subject to the Boost Software
14 2486 sjacqu01
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 2486 sjacqu01
// http://www.boost.org/LICENSE_1_0.txt)
16 2486 sjacqu01
17 2486 sjacqu01
//  See http://www.boost.org for updates, documentation, and revision history.
18 2486 sjacqu01
19 2486 sjacqu01
#include <cstddef> // std::size_t
20 2486 sjacqu01
#include <climits> // ULONG_MAX
21 2486 sjacqu01
#include <string>
22 2486 sjacqu01
23 2486 sjacqu01
#include <boost/config.hpp>
24 2486 sjacqu01
#if defined(BOOST_NO_STDC_NAMESPACE)
25 2486 sjacqu01
namespace std{
26 2486 sjacqu01
    using ::size_t;
27 2486 sjacqu01
} // namespace std
28 2486 sjacqu01
#endif
29 2486 sjacqu01
30 2486 sjacqu01
#include <boost/cstdint.hpp>
31 2486 sjacqu01
32 2486 sjacqu01
#include <boost/archive/detail/iserializer.hpp>
33 2486 sjacqu01
#include <boost/archive/detail/interface_iarchive.hpp>
34 2486 sjacqu01
#include <boost/serialization/nvp.hpp>
35 2486 sjacqu01
#include <boost/archive/detail/register_archive.hpp>
36 2486 sjacqu01
37 2486 sjacqu01
#include <boost/archive/detail/decl.hpp>
38 2486 sjacqu01
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
39 2486 sjacqu01
40 2486 sjacqu01
namespace boost {
41 2486 sjacqu01
namespace serialization {
42 2486 sjacqu01
    class extended_type_info;
43 2486 sjacqu01
} // namespace serialization
44 2486 sjacqu01
namespace archive {
45 2486 sjacqu01
namespace detail {
46 2486 sjacqu01
    class basic_iarchive;
47 2486 sjacqu01
    class basic_iserializer;
48 2486 sjacqu01
}
49 2486 sjacqu01
50 2486 sjacqu01
class polymorphic_iarchive;
51 2486 sjacqu01
52 2486 sjacqu01
class BOOST_SYMBOL_VISIBLE polymorphic_iarchive_impl :
53 2486 sjacqu01
    public detail::interface_iarchive<polymorphic_iarchive>
54 2486 sjacqu01
{
55 2486 sjacqu01
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
56 2486 sjacqu01
public:
57 2486 sjacqu01
#else
58 2486 sjacqu01
    friend class detail::interface_iarchive<polymorphic_iarchive>;
59 2486 sjacqu01
    friend class load_access;
60 2486 sjacqu01
#endif
61 2486 sjacqu01
    // primitive types the only ones permitted by polymorphic archives
62 2486 sjacqu01
    virtual void load(bool & t) = 0;
63 2486 sjacqu01
64 2486 sjacqu01
    virtual void load(char & t) = 0;
65 2486 sjacqu01
    virtual void load(signed char & t) = 0;
66 2486 sjacqu01
    virtual void load(unsigned char & t) = 0;
67 2486 sjacqu01
    #ifndef BOOST_NO_CWCHAR
68 2486 sjacqu01
    #ifndef BOOST_NO_INTRINSIC_WCHAR_T
69 2486 sjacqu01
    virtual void load(wchar_t & t) = 0;
70 2486 sjacqu01
    #endif
71 2486 sjacqu01
    #endif
72 2486 sjacqu01
    virtual void load(short & t) = 0;
73 2486 sjacqu01
    virtual void load(unsigned short & t) = 0;
74 2486 sjacqu01
    virtual void load(int & t) = 0;
75 2486 sjacqu01
    virtual void load(unsigned int & t) = 0;
76 2486 sjacqu01
    virtual void load(long & t) = 0;
77 2486 sjacqu01
    virtual void load(unsigned long & t) = 0;
78 2486 sjacqu01
79 2486 sjacqu01
    #if defined(BOOST_HAS_LONG_LONG)
80 2486 sjacqu01
    virtual void load(boost::long_long_type & t) = 0;
81 2486 sjacqu01
    virtual void load(boost::ulong_long_type & t) = 0;
82 2486 sjacqu01
    #elif defined(BOOST_HAS_MS_INT64)
83 2486 sjacqu01
    virtual void load(__int64 & t) = 0;
84 2486 sjacqu01
    virtual void load(unsigned __int64 & t) = 0;
85 2486 sjacqu01
    #endif
86 2486 sjacqu01
87 2486 sjacqu01
    virtual void load(float & t) = 0;
88 2486 sjacqu01
    virtual void load(double & t) = 0;
89 2486 sjacqu01
90 2486 sjacqu01
    // string types are treated as primitives
91 2486 sjacqu01
    virtual void load(std::string & t) = 0;
92 2486 sjacqu01
    #ifndef BOOST_NO_STD_WSTRING
93 2486 sjacqu01
    virtual void load(std::wstring & t) = 0;
94 2486 sjacqu01
    #endif
95 2486 sjacqu01
96 2486 sjacqu01
    // used for xml and other tagged formats
97 2486 sjacqu01
    virtual void load_start(const char * name) = 0;
98 2486 sjacqu01
    virtual void load_end(const char * name) = 0;
99 2486 sjacqu01
    virtual void register_basic_serializer(const detail::basic_iserializer & bis) = 0;
100 2486 sjacqu01
    virtual detail::helper_collection & get_helper_collection() = 0;
101 2486 sjacqu01
102 2486 sjacqu01
    // msvc and borland won't automatically pass these to the base class so
103 2486 sjacqu01
    // make it explicit here
104 2486 sjacqu01
    template<class T>
105 2486 sjacqu01
    void load_override(T & t)
106 2486 sjacqu01
    {
107 2486 sjacqu01
        archive::load(* this->This(), t);
108 2486 sjacqu01
    }
109 2486 sjacqu01
    // special treatment for name-value pairs.
110 2486 sjacqu01
    template<class T>
111 2486 sjacqu01
    void load_override(
112 2486 sjacqu01
        const boost::serialization::nvp< T > & t
113 2486 sjacqu01
    ){
114 2486 sjacqu01
        load_start(t.name());
115 2486 sjacqu01
        archive::load(* this->This(), t.value());
116 2486 sjacqu01
        load_end(t.name());
117 2486 sjacqu01
    }
118 2486 sjacqu01
protected:
119 2486 sjacqu01
    virtual ~polymorphic_iarchive_impl(){};
120 2486 sjacqu01
public:
121 2486 sjacqu01
    // utility function implemented by all legal archives
122 2486 sjacqu01
    virtual void set_library_version(library_version_type archive_library_version) = 0;
123 2486 sjacqu01
    virtual library_version_type get_library_version() const = 0;
124 2486 sjacqu01
    virtual unsigned int get_flags() const = 0;
125 2486 sjacqu01
    virtual void delete_created_pointers() = 0;
126 2486 sjacqu01
    virtual void reset_object_address(
127 2486 sjacqu01
        const void * new_address,
128 2486 sjacqu01
        const void * old_address
129 2486 sjacqu01
    ) = 0;
130 2486 sjacqu01
131 2486 sjacqu01
    virtual void load_binary(void * t, std::size_t size) = 0;
132 2486 sjacqu01
133 2486 sjacqu01
    // these are used by the serialization library implementation.
134 2486 sjacqu01
    virtual void load_object(
135 2486 sjacqu01
        void *t,
136 2486 sjacqu01
        const detail::basic_iserializer & bis
137 2486 sjacqu01
    ) = 0;
138 2486 sjacqu01
    virtual const detail::basic_pointer_iserializer * load_pointer(
139 2486 sjacqu01
        void * & t,
140 2486 sjacqu01
        const detail::basic_pointer_iserializer * bpis_ptr,
141 2486 sjacqu01
        const detail::basic_pointer_iserializer * (*finder)(
142 2486 sjacqu01
            const boost::serialization::extended_type_info & type
143 2486 sjacqu01
        )
144 2486 sjacqu01
    ) = 0;
145 2486 sjacqu01
};
146 2486 sjacqu01
147 2486 sjacqu01
} // namespace archive
148 2486 sjacqu01
} // namespace boost
149 2486 sjacqu01
150 2486 sjacqu01
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
151 2486 sjacqu01
152 2486 sjacqu01
namespace boost {
153 2486 sjacqu01
namespace archive {
154 2486 sjacqu01
155 2486 sjacqu01
class BOOST_SYMBOL_VISIBLE polymorphic_iarchive :
156 2486 sjacqu01
    public polymorphic_iarchive_impl
157 2486 sjacqu01
{
158 2486 sjacqu01
public:
159 2486 sjacqu01
    virtual ~polymorphic_iarchive(){};
160 2486 sjacqu01
};
161 2486 sjacqu01
162 2486 sjacqu01
} // namespace archive
163 2486 sjacqu01
} // namespace boost
164 2486 sjacqu01
165 2486 sjacqu01
// required by export
166 2486 sjacqu01
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::polymorphic_iarchive)
167 2486 sjacqu01
168 2486 sjacqu01
#endif // BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP