00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00030 #define COVERAGE_IGNORE
00031
00032
00060 #include <boost/version.hpp>
00061 #include <new>
00062
00063
00064
00065
00066 #if BOOST_VERSION < 103600
00067
00068 #ifndef CHASTE_SERIALIZATION_CPP
00069 #include <boost/serialization/export.hpp>
00070 #endif // CHASTE_SERIALIZATION_CPP
00071
00072 #else
00073
00074 #ifdef CHASTE_SERIALIZATION_CPP
00075 #include "CheckpointArchiveTypes.hpp"
00076 #include <boost/serialization/export.hpp>
00077 #endif // CHASTE_SERIALIZATION_CPP
00078
00079 #endif
00080
00081
00082
00083 #ifndef SERIALIZATIONEXPORTWRAPPER_HPP_
00084 #define SERIALIZATIONEXPORTWRAPPER_HPP_
00085
00086
00087
00088 #if (BOOST_VERSION == 103500)
00089 #error "Chaste won't work with Boost 1-35 due to a bug in its serialization library"
00090
00091
00092
00093
00094
00095 #endif
00096
00097
00098 #if BOOST_VERSION >= 104100
00099 #error "Chaste doesn't yet support Boost versions >= 1.41"
00100 #endif
00101
00102
00103
00104
00105 #if BOOST_VERSION >= 103600 && BOOST_VERSION < 103800
00106
00114 #define CHASTE_CLASS_EXPORT_GUID(T, K, S) \
00115 namespace \
00116 { \
00117 ::boost::archive::detail::guid_initializer< T > const & \
00118 BOOST_PP_CAT(BOOST_PP_CAT(boost_serialization_guid_initializer_, __LINE__), S) \
00119 = ::boost::serialization::singleton< \
00120 ::boost::archive::detail::guid_initializer< T > \
00121 >::get_mutable_instance().export_guid(K); \
00122 }
00123
00129 #define CHASTE_CLASS_EXPORT_TEMPLATED(T, S) \
00130 CHASTE_CLASS_EXPORT_GUID( \
00131 T, \
00132 BOOST_PP_STRINGIZE(T), S \
00133 ) \
00134
00135
00139 #define CHASTE_CLASS_EXPORT_INTERNAL(T) \
00140 CHASTE_CLASS_EXPORT_TEMPLATED(T, T)
00141
00142 #else // BOOST_VERSION >= 103600 && BOOST_VERSION < 103800
00143
00144
00150 #define CHASTE_CLASS_EXPORT_TEMPLATED(T, S) \
00151 BOOST_CLASS_EXPORT(T)
00152
00157 #define CHASTE_CLASS_EXPORT_INTERNAL(T) \
00158 BOOST_CLASS_EXPORT(T)
00159 #endif // BOOST_VERSION >= 103600 && BOOST_VERSION < 103800
00160
00161
00162
00163 template<class> struct pack;
00167 template<class T> struct pack<void (T)> {
00168 typedef T type;
00169 };
00170
00171
00172
00173
00174
00183 #define EXPORT_TEMPLATE_CLASS3_INTERNAL(CLASS, E, S, P) \
00184 CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< E,S,P >)>::type, CLASS##E##S##P );
00185
00193 #define EXPORT_TEMPLATE_CLASS2_INTERNAL(CLASS, E, S) \
00194 CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< E,S >)>::type, CLASS##E##S );
00195
00202 #define EXPORT_TEMPLATE_CLASS1_INTERNAL(CLASS, D) \
00203 CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< D >)>::type, CLASS##D );
00204
00211 #define EXPORT_TEMPLATE_CLASS_ALL_DIMS_INTERNAL(CLASS) \
00212 EXPORT_TEMPLATE_CLASS2(CLASS, 1, 1) \
00213 EXPORT_TEMPLATE_CLASS2(CLASS, 1, 2) \
00214 EXPORT_TEMPLATE_CLASS2(CLASS, 1, 3) \
00215 EXPORT_TEMPLATE_CLASS2(CLASS, 2, 2) \
00216 EXPORT_TEMPLATE_CLASS2(CLASS, 2, 3) \
00217 EXPORT_TEMPLATE_CLASS2(CLASS, 3, 3)
00218
00225 #define EXPORT_TEMPLATE_CLASS_SAME_DIMS_INTERNAL(CLASS) \
00226 EXPORT_TEMPLATE_CLASS1(CLASS, 1) \
00227 EXPORT_TEMPLATE_CLASS1(CLASS, 2) \
00228 EXPORT_TEMPLATE_CLASS1(CLASS, 3)
00229
00230
00231 #endif // SERIALIZATIONEXPORTWRAPPER_HPP_
00232
00233
00234
00235
00236
00237 #if !defined(CHASTE_CLASS_EXPORT) || defined(CHASTE_SERIALIZATION_CPP)
00238 #ifdef CHASTE_SERIALIZATION_CPP
00239
00240 #undef CHASTE_CLASS_EXPORT
00241 #undef EXPORT_TEMPLATE_CLASS_SAME_DIMS
00242 #undef EXPORT_TEMPLATE_CLASS_ALL_DIMS
00243 #undef EXPORT_TEMPLATE_CLASS1
00244 #undef EXPORT_TEMPLATE_CLASS2
00245 #undef EXPORT_TEMPLATE_CLASS3
00246 #endif // CHASTE_SERIALIZATION_CPP
00247
00248
00249 #if (BOOST_VERSION < 103600 && ! defined(CHASTE_SERIALIZATION_CPP)) || \
00250 (BOOST_VERSION >= 103600 && defined(CHASTE_SERIALIZATION_CPP))
00251
00252
00253
00258 #define CHASTE_CLASS_EXPORT(T) CHASTE_CLASS_EXPORT_INTERNAL(T)
00259
00264 #define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS) EXPORT_TEMPLATE_CLASS_SAME_DIMS_INTERNAL(CLASS)
00265
00270 #define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS) EXPORT_TEMPLATE_CLASS_ALL_DIMS_INTERNAL(CLASS)
00271
00276 #define EXPORT_TEMPLATE_CLASS1(CLASS, D) EXPORT_TEMPLATE_CLASS1_INTERNAL(CLASS, D)
00277
00283 #define EXPORT_TEMPLATE_CLASS2(CLASS, E, S) EXPORT_TEMPLATE_CLASS2_INTERNAL(CLASS, E, S)
00284
00291 #define EXPORT_TEMPLATE_CLASS3(CLASS, E, S, P) EXPORT_TEMPLATE_CLASS3_INTERNAL(CLASS, E, S, P)
00292
00293 #else
00294
00299 #define CHASTE_CLASS_EXPORT(T)
00300
00304 #define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
00305
00309 #define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
00310
00315 #define EXPORT_TEMPLATE_CLASS1(CLASS, D)
00316
00322 #define EXPORT_TEMPLATE_CLASS2(CLASS, E, S)
00323
00330 #define EXPORT_TEMPLATE_CLASS3(CLASS, E, S, P)
00331
00332 #endif
00333 #endif
00334
00335
00336
00337 #undef COVERAGE_IGNORE