1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/serialization/access.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,130 @@
1.4 +#ifndef BOOST_SERIALIZATION_ACCESS_HPP
1.5 +#define BOOST_SERIALIZATION_ACCESS_HPP
1.6 +
1.7 +// MS compatible compilers support #pragma once
1.8 +#if defined(_MSC_VER) && (_MSC_VER >= 1020)
1.9 +# pragma once
1.10 +#endif
1.11 +
1.12 +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
1.13 +// access.hpp: interface for serialization system.
1.14 +
1.15 +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
1.16 +// Use, modification and distribution is subject to the Boost Software
1.17 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.18 +// http://www.boost.org/LICENSE_1_0.txt)
1.19 +
1.20 +// See http://www.boost.org for updates, documentation, and revision history.
1.21 +
1.22 +#include <boost/config.hpp>
1.23 +
1.24 +#include <boost/pfto.hpp>
1.25 +
1.26 +namespace boost {
1.27 +
1.28 +namespace archive {
1.29 +namespace detail {
1.30 + template<class Archive, class T>
1.31 + class iserializer;
1.32 + template<class Archive, class T>
1.33 + class oserializer;
1.34 +} // namespace detail
1.35 +} // namespace archive
1.36 +
1.37 +namespace serialization {
1.38 +
1.39 +// forward declarations
1.40 +template<class Archive, class T>
1.41 +inline void serialize_adl(Archive &, T &, const unsigned int);
1.42 +namespace detail {
1.43 + template<class Archive, class T>
1.44 + struct member_saver;
1.45 + template<class Archive, class T>
1.46 + struct member_loader;
1.47 +} // namespace detail
1.48 +
1.49 +// use an "accessor class so that we can use:
1.50 +// "friend class boost::serialization::access;"
1.51 +// in any serialized class to permit clean, safe access to private class members
1.52 +// by the serialization system
1.53 +
1.54 +class access {
1.55 +public:
1.56 + // grant access to "real" serialization defaults
1.57 +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
1.58 +public:
1.59 +#else
1.60 + template<class Archive, class T>
1.61 + friend struct detail::member_saver;
1.62 + template<class Archive, class T>
1.63 + friend struct detail::member_loader;
1.64 + template<class Archive, class T>
1.65 + friend class archive::detail::iserializer;
1.66 + template<class Archive, class T>
1.67 + friend class archive::detail::oserializer;
1.68 + template<class Archive, class T>
1.69 + friend inline void serialize(
1.70 + Archive & ar,
1.71 + T & t,
1.72 + const BOOST_PFTO unsigned int file_version
1.73 + );
1.74 + template<class Archive, class T>
1.75 + friend inline void save_construct_data(
1.76 + Archive & ar,
1.77 + const T * t,
1.78 + const BOOST_PFTO unsigned int file_version
1.79 + );
1.80 + template<class Archive, class T>
1.81 + friend inline void load_construct_data(
1.82 + Archive & ar,
1.83 + T * t,
1.84 + const BOOST_PFTO unsigned int file_version
1.85 + );
1.86 +#endif
1.87 +
1.88 + // pass calls to users's class implementation
1.89 + template<class Archive, class T>
1.90 + static void member_save(
1.91 + Archive & ar,
1.92 + //const T & t,
1.93 + T & t,
1.94 + const unsigned int file_version
1.95 + ){
1.96 + t.save(ar, file_version);
1.97 + }
1.98 + template<class Archive, class T>
1.99 + static void member_load(
1.100 + Archive & ar,
1.101 + T & t,
1.102 + const unsigned int file_version
1.103 + ){
1.104 + t.load(ar, file_version);
1.105 + }
1.106 + template<class Archive, class T>
1.107 + static void serialize(
1.108 + Archive & ar,
1.109 + T & t,
1.110 + const unsigned int file_version
1.111 + ){
1.112 + t.serialize(ar, file_version);
1.113 + }
1.114 + template<class T>
1.115 + static void destroy( const T * t) // const appropriate here?
1.116 + {
1.117 + // the const business is an MSVC 6.0 hack that should be
1.118 + // benign on everything else
1.119 + delete const_cast<T *>(t);
1.120 + }
1.121 + template<class Archive, class T>
1.122 + static void construct(Archive & /* ar */, T * t){
1.123 + // default is inplace invocation of default constructor
1.124 + // Note the :: before the placement new. Required if the
1.125 + // class doesn't have a class-specific placement new defined.
1.126 + ::new(t)T;
1.127 + }
1.128 +};
1.129 +
1.130 +} // namespace serialization
1.131 +} // namespace boost
1.132 +
1.133 +#endif // BOOST_SERIALIZATION_ACCESS_HPP