Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
CellPropertyRegistry Class Reference

#include <CellPropertyRegistry.hpp>

+ Collaboration diagram for CellPropertyRegistry:

Public Member Functions

template<class SUBCLASS >
boost::shared_ptr< AbstractCellPropertyGet ()
 
const std::vector< boost::shared_ptr< AbstractCellProperty > > & rGetAllCellProperties ()
 
void Clear ()
 
CellPropertyRegistryTakeOwnership ()
 
void SpecifyOrdering (const std::vector< boost::shared_ptr< AbstractCellProperty > > &rOrdering)
 
bool HasOrderingBeenSpecified ()
 

Static Public Member Functions

static CellPropertyRegistryInstance ()
 

Private Member Functions

 CellPropertyRegistry ()
 
 CellPropertyRegistry (const CellPropertyRegistry &)
 
CellPropertyRegistryoperator= (const CellPropertyRegistry &)
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

std::vector< boost::shared_ptr< AbstractCellProperty > > mCellProperties
 
bool mOrderingHasBeenSpecified
 

Static Private Attributes

static CellPropertyRegistrympInstance = nullptr
 

Friends

class boost::serialization::access
 

Detailed Description

A singleton registry of available cell properties.

Definition at line 51 of file CellPropertyRegistry.hpp.

Constructor & Destructor Documentation

◆ CellPropertyRegistry() [1/2]

CellPropertyRegistry::CellPropertyRegistry ( )
private

Default constructor.

Definition at line 63 of file CellPropertyRegistry.cpp.

Referenced by Instance().

◆ CellPropertyRegistry() [2/2]

CellPropertyRegistry::CellPropertyRegistry ( const CellPropertyRegistry )
private

Copy constructor.

Member Function Documentation

◆ Clear()

void CellPropertyRegistry::Clear ( )

◆ Get()

template<class SUBCLASS >
boost::shared_ptr< AbstractCellProperty > CellPropertyRegistry::Get ( )

The main interface to this class.

Returns
a particular cell property object. Use like: boost::shared_ptr<AbstractCellProperty> p_property( CellPropertyRegistry::Instance()->Get<WildTypeCellMutationState>());

Definition at line 153 of file CellPropertyRegistry.hpp.

References Get(), and mCellProperties.

Referenced by Get(), serialize(), SpecifyOrdering(), and Cell::StartApoptosis().

◆ HasOrderingBeenSpecified()

bool CellPropertyRegistry::HasOrderingBeenSpecified ( )
Returns
whether an ordering has been specified.

Definition at line 96 of file CellPropertyRegistry.cpp.

References mOrderingHasBeenSpecified.

◆ Instance()

◆ operator=()

Overloaded assignment operator.

Returns
reference by convention

◆ rGetAllCellProperties()

const std::vector< boost::shared_ptr< AbstractCellProperty > > & CellPropertyRegistry::rGetAllCellProperties ( )
Returns
a list of the cell properties registered.

Definition at line 52 of file CellPropertyRegistry.cpp.

References mCellProperties.

◆ serialize()

template<class Archive >
void CellPropertyRegistry::serialize ( Archive archive,
const unsigned int  version 
)
inlineprivate

Archive the member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 145 of file CellPropertyRegistry.hpp.

References Get(), mCellProperties, and mOrderingHasBeenSpecified.

◆ SpecifyOrdering()

void CellPropertyRegistry::SpecifyOrdering ( const std::vector< boost::shared_ptr< AbstractCellProperty > > &  rOrdering)

Specify the ordering in which cell properties should be returned by rGetAllCellProperties(). The provided ordering must include all cell properties in the registry. Once an ordering has been specified, attempts to get a cell property which is not in the ordering will throw an exception.

Parameters
rOrderingvector of cell properties in the desired order

Definition at line 74 of file CellPropertyRegistry.cpp.

References EXCEPTION, Get(), mCellProperties, and mOrderingHasBeenSpecified.

◆ TakeOwnership()

CellPropertyRegistry * CellPropertyRegistry::TakeOwnership ( )

Take ownership of the current registry. Calling Instance after this will create a new registry. The caller takes responsibility for freeing the returned registry when finished with it.

This method is intended for use by CellBasedSimulation, so that we can have multiple concurrent simulations, each with their own registry.

Returns
registry

Definition at line 68 of file CellPropertyRegistry.cpp.

References mpInstance.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 137 of file CellPropertyRegistry.hpp.

Member Data Documentation

◆ mCellProperties

std::vector<boost::shared_ptr<AbstractCellProperty> > CellPropertyRegistry::mCellProperties
private

The cell properties in the registry.

Definition at line 131 of file CellPropertyRegistry.hpp.

Referenced by Clear(), Get(), rGetAllCellProperties(), serialize(), and SpecifyOrdering().

◆ mOrderingHasBeenSpecified

bool CellPropertyRegistry::mOrderingHasBeenSpecified
private

Whether an ordering has been set up

Definition at line 134 of file CellPropertyRegistry.hpp.

Referenced by Clear(), HasOrderingBeenSpecified(), serialize(), and SpecifyOrdering().

◆ mpInstance

CellPropertyRegistry * CellPropertyRegistry::mpInstance = nullptr
staticprivate

A pointer to the singleton instance of this class.

Definition at line 126 of file CellPropertyRegistry.hpp.

Referenced by Instance(), and TakeOwnership().


The documentation for this class was generated from the following files: