#include <Identifiable.hpp>
Inherited by AbstractCaUpdateRule< DIM >, AbstractCellBasedSimulation< DIM >, AbstractCellCycleModel, AbstractCellKiller< SPACE_DIM >, AbstractCellKiller< 2 >, AbstractCellKiller< DIM >, AbstractCellPopulation< DIM >, AbstractCellPopulation< SPACE_DIM >, AbstractCellPopulationBoundaryCondition< DIM >, AbstractCellProperty, AbstractForce< DIM >, AbstractIvpOdeSolver, AbstractPottsUpdateRule< DIM >, and CellBasedPdeHandler< DIM >.
Public Member Functions | |
virtual | ~Identifiable () |
std::string | GetIdentifier () const |
Private Member Functions | |
std::string | TidyTemplatedExportIdentifier (std::string identifier) const |
"Mix-in" base class for any class that needs to provide a unique ID specifying what type the derived class is.
All you need to do to use this is inherit from this class at the base of your hierarchy, and provide a Boost Serialization export key for every concrete class. Also, any test in which the GetIdentifier method is used, even via the main cell_based code, must include CheckpointArchiveTypes.hpp or CellBasedSimulationArchiver.hpp as the first Chaste header included. Failure to do so will result in a seg fault.
Definition at line 52 of file Identifiable.hpp.
Identifiable::~Identifiable | ( | ) | [virtual] |
Virtual destructor to make this class polymorphic.
Definition at line 85 of file Identifiable.cpp.
std::string Identifiable::GetIdentifier | ( | ) | const |
Return the unique identifier of the concrete class.
This method uses Boost's serialization's extended_type_info and returns the identifier of the derived class (this is defined when the macro CHASTE_CLASS_EXPORT is invoked in each derived class, and is usually just the name of the class).
Note that you must include the header CheckpointArchiveTypes.hpp in any test suite that calls this method.
Definition at line 89 of file Identifiable.cpp.
References TidyTemplatedExportIdentifier().
Referenced by AbstractCellCycleModel::OutputCellCycleModelInfo(), AbstractCellKiller< DIM >::OutputCellKillerInfo(), AbstractCellPopulationBoundaryCondition< DIM >::OutputCellPopulationBoundaryConditionInfo(), AbstractCellPopulation< DIM >::OutputCellPopulationInfo(), AbstractForce< DIM >::OutputForceInfo(), CellBasedPdeHandler< DIM >::OutputParameters(), AbstractCellBasedSimulation< DIM >::OutputSimulationSetup(), AbstractPottsUpdateRule< DIM >::OutputUpdateRuleInfo(), AbstractCaUpdateRule< DIM >::OutputUpdateRuleInfo(), and AbstractOneStepIvpOdeSolver::Solve().
std::string Identifiable::TidyTemplatedExportIdentifier | ( | std::string | identifier | ) | const [private] |
Templated classes get Boost Serialization export keys that look like "pack<void (NameOfDerivedType< DIM >)>::type". This method converts it to a nice name suitable for use as an XML element name, i.e. of the form "NameOfDerivedType-DIM". Works for classes templated over any number of parameters, providing the values are allowable in XML element names.
identifier | the identifier to tidy |
#1453 There are currently no identifiables with multiple template parameters...
Definition at line 39 of file Identifiable.cpp.
Referenced by GetIdentifier().