SerializationExportWrapper.hpp File Reference

#include <boost/version.hpp>
#include <new>
#include <boost/serialization/export.hpp>
Include dependency graph for SerializationExportWrapper.hpp:

Go to the source code of this file.

Classes

struct  pack< void(T)>

Defines

#define COVERAGE_IGNORE
 gcov doesn't like this file...
#define CHASTE_CLASS_EXPORT_TEMPLATED(T, S)   BOOST_CLASS_EXPORT(T)
#define CHASTE_CLASS_EXPORT_INTERNAL(T)   BOOST_CLASS_EXPORT(T)
#define EXPORT_TEMPLATE_CLASS3_INTERNAL(CLASS, E, S, P)   CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< E,S,P >)>::type, CLASS##E##S##P );
#define EXPORT_TEMPLATE_CLASS2_INTERNAL(CLASS, E, S)   CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< E,S >)>::type, CLASS##E##S );
#define EXPORT_TEMPLATE_CLASS1_INTERNAL(CLASS, D)   CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< D >)>::type, CLASS##D );
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS_INTERNAL(CLASS)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS_INTERNAL(CLASS)
#define CHASTE_CLASS_EXPORT(T)   CHASTE_CLASS_EXPORT_INTERNAL(T)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)   EXPORT_TEMPLATE_CLASS_SAME_DIMS_INTERNAL(CLASS)
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)   EXPORT_TEMPLATE_CLASS_ALL_DIMS_INTERNAL(CLASS)
#define EXPORT_TEMPLATE_CLASS1(CLASS, D)   EXPORT_TEMPLATE_CLASS1_INTERNAL(CLASS, D)
#define EXPORT_TEMPLATE_CLASS2(CLASS, E, S)   EXPORT_TEMPLATE_CLASS2_INTERNAL(CLASS, E, S)
#define EXPORT_TEMPLATE_CLASS3(CLASS, E, S, P)   EXPORT_TEMPLATE_CLASS3_INTERNAL(CLASS, E, S, P)

Detailed Description

Defines some macros to register versions of templated classes with the serialization library, for all space dimensions. Also contains wrappers around BOOST_CLASS_EXPORT and related functionality, which take care of the differences introduced in new versions of Boost.

In Boost 1.33.1 and 1.34, BOOST_CLASS_EXPORT should be placed in the .hpp file for each class, and archive headers included only in tests, or special 'archiver' class header files (e.g. CardiacSimulationArchiver.hpp).

Serialization is broken in Boost 1.35.

In Boost 1.36 (and up to 1.40) both the archive header includes and the BOOST_CLASS_EXPORT should go in .cpp files.

We don't yet support 1.41 and above, which introduce BOOST_CLASS_EXPORT_KEY and BOOST_CLASS_EXPORT_IMPLEMENT.

To handle all situations in Chaste: 1. In .hpp files, include this header after the class definition. 2. In .cpp files, after any other includes, include SerializationExportWrapperForCpp.hpp. In both cases, CHASTE_CLASS_EXPORT should be used instead of BOOST_CLASS_EXPORT. There are also variant macros for common cases of templated classes, which are certainly needed for Boost versions before 1.38.

Definition in file SerializationExportWrapper.hpp.


Define Documentation

#define CHASTE_CLASS_EXPORT (  )     CHASTE_CLASS_EXPORT_INTERNAL(T)

Define the serialization export key for this class.

Parameters:
T the class

Definition at line 258 of file SerializationExportWrapper.hpp.

#define CHASTE_CLASS_EXPORT_INTERNAL (  )     BOOST_CLASS_EXPORT(T)

What CHASTE_CLASS_EXPORT expands to when it isn't a no-op.

Parameters:
T the class to export

Definition at line 157 of file SerializationExportWrapper.hpp.

#define CHASTE_CLASS_EXPORT_TEMPLATED ( T,
 )     BOOST_CLASS_EXPORT(T)

General export for templated classes.

Parameters:
T a type
S a unique string for the class + specific template parameter values

Definition at line 150 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS1 ( CLASS,
 )     EXPORT_TEMPLATE_CLASS1_INTERNAL(CLASS, D)

Export a templated class with 1 parameter.

Parameters:
CLASS the class (without parameters)
D template parameter

Definition at line 276 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS1_INTERNAL ( CLASS,
 )     CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< D >)>::type, CLASS##D );

Export a templated class with 1 parameter. This is the definition of EXPORT_TEMPLATE_CLASS1 when it isn't a no-op.

Parameters:
CLASS the class (without parameters)
D template parameter

Definition at line 202 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS2 ( CLASS,
E,
 )     EXPORT_TEMPLATE_CLASS2_INTERNAL(CLASS, E, S)

Export a templated class with 2 parameters.

Parameters:
CLASS the class (without parameters)
E first template parameter
S second template parameter

Definition at line 283 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS2_INTERNAL ( CLASS,
E,
 )     CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< E,S >)>::type, CLASS##E##S );

Export a templated class with 2 parameters. This is the definition of EXPORT_TEMPLATE_CLASS2 when it isn't a no-op.

Parameters:
CLASS the class (without parameters)
E first template parameter
S second template parameter

Definition at line 193 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS3 ( CLASS,
E,
S,
 )     EXPORT_TEMPLATE_CLASS3_INTERNAL(CLASS, E, S, P)

Export a templated class with 3 parameters.

Parameters:
CLASS the class (without parameters)
E first template parameter
S second template parameter
P third template parameter

Definition at line 291 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS3_INTERNAL ( CLASS,
E,
S,
 )     CHASTE_CLASS_EXPORT_TEMPLATED( pack<void (CLASS< E,S,P >)>::type, CLASS##E##S##P );

Export a templated class with 3 parameters. This is the definition of EXPORT_TEMPLATE_CLASS3 when it isn't a no-op.

Parameters:
CLASS the class (without parameters)
E first template parameter
S second template parameter
P third template parameter

Definition at line 183 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS_ALL_DIMS ( CLASS   )     EXPORT_TEMPLATE_CLASS_ALL_DIMS_INTERNAL(CLASS)

Export a class templated over both element and space dimension, for all valid combinations.

Parameters:
CLASS the class (without parameters)

Definition at line 270 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS_ALL_DIMS_INTERNAL ( CLASS   ) 
Value:
EXPORT_TEMPLATE_CLASS2(CLASS, 1, 1) \
    EXPORT_TEMPLATE_CLASS2(CLASS, 1, 2) \
    EXPORT_TEMPLATE_CLASS2(CLASS, 1, 3) \
    EXPORT_TEMPLATE_CLASS2(CLASS, 2, 2) \
    EXPORT_TEMPLATE_CLASS2(CLASS, 2, 3) \
    EXPORT_TEMPLATE_CLASS2(CLASS, 3, 3)

Export a class templated over both element and space dimension, for all valid combinations. This is the definition of EXPORT_TEMPLATE_CLASS_ALL_DIMS when it isn't a no-op.

Parameters:
CLASS the class (without parameters)

Definition at line 211 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS_SAME_DIMS ( CLASS   )     EXPORT_TEMPLATE_CLASS_SAME_DIMS_INTERNAL(CLASS)

Export a class templated over both element and space dimension, for combinations where ELEMENT_DIM == SPACE_DIM.

Parameters:
CLASS the class (without parameters)

Definition at line 264 of file SerializationExportWrapper.hpp.

#define EXPORT_TEMPLATE_CLASS_SAME_DIMS_INTERNAL ( CLASS   ) 
Value:

Export a class templated over both element and space dimension, for combinations where ELEMENT_DIM == SPACE_DIM. This is the definition of EXPORT_TEMPLATE_CLASS_SAME_DIMS when it isn't a no-op.

Parameters:
CLASS the class (without parameters)

Definition at line 225 of file SerializationExportWrapper.hpp.


Generated by  doxygen 1.6.2