Chaste Release::3.1
ClassIsAbstract.hpp File Reference
#include <boost/version.hpp>
#include <boost/serialization/is_abstract.hpp>
Include dependency graph for ClassIsAbstract.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CLASS_IS_ABSTRACT(T)   BOOST_IS_ABSTRACT(T)
#define TEMPLATED_CLASS_IS_ABSTRACT_DEFN
#define TEMPLATED_CLASS_IS_ABSTRACT_1_UNSIGNED(T)
#define TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(T)
#define TEMPLATED_CLASS_IS_ABSTRACT_3_UNSIGNED(T)

Detailed Description

This file defines 4 macros to assist with explicitly declaring to the Boost Serialization library when a class is abstract. The interface for doing this changed in Boost 1.36.0, hence this wrapper.

The easy case is for a non-templated class. For example, if you have a class called AbstractClass, use CLASS_IS_ABSTRACT(AbstractClass)

For classes templated over either 1 or 2 unsigned parameters, there are helper macros TEMPLATED_CLASS_IS_ABSTRACT_1_UNSIGNED and TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED. For example, with a class template<unsigned SPACE_DIM, unsigned ELEMENT_DIM> class AbstractTemplatedClass { ... }; use TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(AbstractTemplatedClass)

For a general templated class, you have to do a little extra work. For example, with a class template<class C, unsigned U> class AbstractTemplatedClass { ... }; use namespace boost { namespace serialization { template<class C, unsigned U> struct is_abstract<AbstractTemplatedClass<C, U> > TEMPLATED_CLASS_IS_ABSTRACT_DEFN template<class C, unsigned U> struct is_abstract<const AbstractTemplatedClass<C, U> > TEMPLATED_CLASS_IS_ABSTRACT_DEFN }}

Definition in file ClassIsAbstract.hpp.


Define Documentation

#define CLASS_IS_ABSTRACT (   T)    BOOST_IS_ABSTRACT(T)

Explicitly mark a non-templated class as being abstract (Boost 1.35 and earlier).

Parameters:
Tthe class

Definition at line 105 of file ClassIsAbstract.hpp.

#define TEMPLATED_CLASS_IS_ABSTRACT_1_UNSIGNED (   T)
Value:
namespace boost { \
    namespace serialization { \
    template<unsigned U> \
    struct is_abstract<T<U> > \
        TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
    template<unsigned U> \
    struct is_abstract<const T<U> > \
        TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
    }}

Convenience macro to declare a class templated over a single unsigned as abstract.

Parameters:
Tthe class

Definition at line 124 of file ClassIsAbstract.hpp.

#define TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED (   T)
Value:
namespace boost { \
    namespace serialization { \
    template<unsigned U1, unsigned U2> \
    struct is_abstract<T<U1, U2> > \
        TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
    template<unsigned U1, unsigned U2> \
    struct is_abstract<const T<U1, U2> > \
        TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
    }}

Convenience macro to declare a class templated over 2 unsigneds as abstract.

Parameters:
Tthe class

Definition at line 140 of file ClassIsAbstract.hpp.

#define TEMPLATED_CLASS_IS_ABSTRACT_3_UNSIGNED (   T)
Value:
namespace boost { \
    namespace serialization { \
    template<unsigned U1, unsigned U2, unsigned U3> \
    struct is_abstract<T<U1, U2, U3> > \
        TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
    template<unsigned U1, unsigned U2, unsigned U3> \
    struct is_abstract<const T<U1, U2, U3> > \
        TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
    }}

Convenience macro to declare a class templated over 3 unsigneds as abstract.

Parameters:
Tthe class

Definition at line 156 of file ClassIsAbstract.hpp.

#define TEMPLATED_CLASS_IS_ABSTRACT_DEFN
Value:
{ \
        typedef mpl::bool_<true> type; \
        BOOST_STATIC_CONSTANT(bool, value = true); \
    };

Content of the is_abstract type to mark a templated class as abstract (Boost 1.35 and earlier).

Definition at line 111 of file ClassIsAbstract.hpp.