File indexing completed on 2024-11-15 09:30:59
0001 #ifndef BOOST_SERIALIZATION_ACCESS_HPP
0002 #define BOOST_SERIALIZATION_ACCESS_HPP
0003
0004
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <boost/config.hpp>
0020
0021 namespace boost {
0022
0023 namespace archive {
0024 namespace detail {
0025 template<class Archive, class T>
0026 class iserializer;
0027 template<class Archive, class T>
0028 class oserializer;
0029 }
0030 }
0031
0032 namespace serialization {
0033
0034
0035 template<class Archive, class T>
0036 inline void serialize_adl(Archive &, T &, const unsigned int);
0037 namespace detail {
0038 template<class Archive, class T>
0039 struct member_saver;
0040 template<class Archive, class T>
0041 struct member_loader;
0042 }
0043
0044
0045
0046
0047
0048
0049 class access {
0050 public:
0051
0052 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0053 public:
0054 #else
0055 template<class Archive, class T>
0056 friend struct detail::member_saver;
0057 template<class Archive, class T>
0058 friend struct detail::member_loader;
0059 template<class Archive, class T>
0060 friend class archive::detail::iserializer;
0061 template<class Archive, class T>
0062 friend class archive::detail::oserializer;
0063 template<class Archive, class T>
0064 friend inline void serialize(
0065 Archive & ar,
0066 T & t,
0067 const unsigned int file_version
0068 );
0069 template<class Archive, class T>
0070 friend inline void save_construct_data(
0071 Archive & ar,
0072 const T * t,
0073 const unsigned int file_version
0074 );
0075 template<class Archive, class T>
0076 friend inline void load_construct_data(
0077 Archive & ar,
0078 T * t,
0079 const unsigned int file_version
0080 );
0081 #endif
0082
0083
0084 template<class Archive, class T>
0085 static void member_save(
0086 Archive & ar,
0087
0088 T & t,
0089 const unsigned int file_version
0090 ){
0091 t.save(ar, file_version);
0092 }
0093 template<class Archive, class T>
0094 static void member_load(
0095 Archive & ar,
0096 T & t,
0097 const unsigned int file_version
0098 ){
0099 t.load(ar, file_version);
0100 }
0101 template<class Archive, class T>
0102 static void serialize(
0103 Archive & ar,
0104 T & t,
0105 const unsigned int file_version
0106 ){
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116 t.serialize(ar, file_version);
0117 }
0118 template<class T>
0119 static void destroy( const T * t)
0120 {
0121
0122
0123 delete const_cast<T *>(t);
0124 }
0125 template<class T>
0126 static void construct(T * t){
0127
0128
0129
0130 ::new(t)T;
0131 }
0132 template<class T, class U>
0133 static T & cast_reference(U & u){
0134 return static_cast<T &>(u);
0135 }
0136 template<class T, class U>
0137 static T * cast_pointer(U * u){
0138 return static_cast<T *>(u);
0139 }
0140 };
0141
0142 }
0143 }
0144
0145 #endif