Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/boost/archive/detail/archive_pointer_iserializer.hpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 2.8 KB
Line 
1#ifndef BOOST_ARCHIVE_ARCHIVE_POINTER_ISERIALIZER_POINTER_HPP
2#define BOOST_ARCHIVE_ARCHIVE_POINTER_ISERIALIZER_POINTER_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// archive_pointer_iserializer.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 <cassert>
20#include <boost/config.hpp>
21#include <boost/detail/workaround.hpp>
22
23#include <boost/archive/detail/basic_serializer.hpp>
24#include <boost/archive/detail/basic_pointer_iserializer.hpp>
25
26#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
27
28namespace boost {
29
30namespace serialization {
31    class extended_type_info;
32} // namespace serialization
33
34namespace archive {
35namespace detail {
36
37template<class Archive>
38class archive_pointer_iserializer : 
39    public basic_pointer_iserializer {
40protected:
41    explicit BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) 
42    archive_pointer_iserializer(
43        const boost::serialization::extended_type_info & eti
44    );
45    BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) 
46    // account for bogus gcc warning
47    #if defined(__GNUC__)
48    virtual
49    #endif
50    ~archive_pointer_iserializer();
51public:
52    virtual const basic_iserializer & get_basic_serializer() const 
53    // mscvc 6.0 requires template functions to be implemented. For this
54    // reason we can't make abstract.
55    #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || defined(__MWERKS__)
56    {
57        assert(false);
58        return *static_cast<const basic_iserializer *>(NULL);
59    }
60    #else
61    = 0;
62    #endif
63    virtual void load_object_ptr(
64        basic_iarchive  & ar, 
65        void * & x,
66        const unsigned int file_version
67    ) const 
68    #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || defined(__MWERKS__)
69    {
70        assert(false);
71    }
72    #else
73    = 0;
74    #endif
75    // return the type_extended load pointer corresponding to a given
76    // type_info.  returns NULL if there is no such instance. This
77    // would indicate that the no object of the specified type was loaded
78    // any where in the code.
79    static
80    BOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_pointer_iserializer *)
81    find(
82        const boost::serialization::extended_type_info & eti
83    );
84};
85
86} // namespace detail
87} // namespace archive
88} // namespace boost
89
90#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
91
92#endif // BOOST_ARCHIVE_ARCHIVE_POINTER_ISERIALIZER_POINTER_HPP
Note: See TracBrowser for help on using the repository browser.