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