1 #ifndef BOOST_SERIALIZATION_ACCESS_HPP
2 #define BOOST_SERIALIZATION_ACCESS_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // access.hpp: interface for serialization system.
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)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/config.hpp>
21 #include <boost/serialization/pfto.hpp>
27 template<class Archive
, class T
>
29 template<class Archive
, class T
>
32 } // namespace archive
34 namespace serialization
{
36 // forward declarations
37 template<class Archive
, class T
>
38 inline void serialize_adl(Archive
&, T
&, const unsigned int);
40 template<class Archive
, class T
>
42 template<class Archive
, class T
>
46 // use an "accessor class so that we can use:
47 // "friend class boost::serialization::access;"
48 // in any serialized class to permit clean, safe access to private class members
49 // by the serialization system
53 // grant access to "real" serialization defaults
54 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
57 template<class Archive
, class T
>
58 friend struct detail::member_saver
;
59 template<class Archive
, class T
>
60 friend struct detail::member_loader
;
61 template<class Archive
, class T
>
62 friend class archive::detail::iserializer
;
63 template<class Archive
, class T
>
64 friend class archive::detail::oserializer
;
65 template<class Archive
, class T
>
66 friend inline void serialize(
69 const BOOST_PFTO
unsigned int file_version
71 template<class Archive
, class T
>
72 friend inline void save_construct_data(
75 const BOOST_PFTO
unsigned int file_version
77 template<class Archive
, class T
>
78 friend inline void load_construct_data(
81 const BOOST_PFTO
unsigned int file_version
85 // pass calls to users's class implementation
86 template<class Archive
, class T
>
87 static void member_save(
91 const unsigned int file_version
93 t
.save(ar
, file_version
);
95 template<class Archive
, class T
>
96 static void member_load(
99 const unsigned int file_version
101 t
.load(ar
, file_version
);
103 template<class Archive
, class T
>
104 static void serialize(
107 const unsigned int file_version
109 t
.serialize(ar
, file_version
);
112 static void destroy( const T
* t
) // const appropriate here?
114 // the const business is an MSVC 6.0 hack that should be
115 // benign on everything else
116 delete const_cast<T
*>(t
);
118 template<class Archive
, class T
>
119 static void construct(Archive
& /* ar */, T
* t
){
120 // default is inplace invocation of default constructor
121 // Note the :: before the placement new. Required if the
122 // class doesn't have a class-specific placement new defined.
127 } // namespace serialization
130 #endif // BOOST_SERIALIZATION_ACCESS_HPP