ClassIsAbstract.hpp

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 #ifndef CLASSISABSTRACT_HPP_
00030 #define CLASSISABSTRACT_HPP_
00031 
00067 #include <boost/version.hpp>
00068 
00069 #if BOOST_VERSION >= 103600
00070 
00071 // In Boost since 1.36.0, we need to use assume_abstract...
00072 #include <boost/serialization/assume_abstract.hpp>
00073 
00079 #define CLASS_IS_ABSTRACT(T) BOOST_SERIALIZATION_ASSUME_ABSTRACT(T)
00080 
00085 #define TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00086     : boost::true_type {};
00087 
00088 #else
00089 
00090 // In Boost before 1.36.0, we use is_abstract...
00091 #include <boost/serialization/is_abstract.hpp>
00092 
00098 #define CLASS_IS_ABSTRACT(T) BOOST_IS_ABSTRACT(T)
00099 
00104 #define TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00105     { \
00106         typedef mpl::bool_<true> type; \
00107         BOOST_STATIC_CONSTANT(bool, value = true); \
00108     };
00109 
00110 #endif // BOOST_VERSION >= 103600
00111 
00117 #define TEMPLATED_CLASS_IS_ABSTRACT_1_UNSIGNED(T) \
00118     namespace boost { \
00119     namespace serialization { \
00120     template<unsigned U> \
00121     struct is_abstract<T<U> > \
00122         TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00123     template<unsigned U> \
00124     struct is_abstract<const T<U> > \
00125         TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00126     }}
00127 
00133 #define TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(T) \
00134     namespace boost { \
00135     namespace serialization { \
00136     template<unsigned U1, unsigned U2> \
00137     struct is_abstract<T<U1, U2> > \
00138         TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00139     template<unsigned U1, unsigned U2> \
00140     struct is_abstract<const T<U1, U2> > \
00141         TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00142     }}
00143 
00149 #define TEMPLATED_CLASS_IS_ABSTRACT_3_UNSIGNED(T) \
00150     namespace boost { \
00151     namespace serialization { \
00152     template<unsigned U1, unsigned U2, unsigned U3> \
00153     struct is_abstract<T<U1, U2, U3> > \
00154         TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00155     template<unsigned U1, unsigned U2, unsigned U3> \
00156     struct is_abstract<const T<U1, U2, U3> > \
00157         TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
00158     }}
00159 
00160 #endif /*CLASSISABSTRACT_HPP_*/

Generated on Mon Apr 18 11:35:28 2011 for Chaste by  doxygen 1.5.5