Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
CellPropertyCollection Class Reference

#include <CellPropertyCollection.hpp>

+ Collaboration diagram for CellPropertyCollection:

Public Types

typedef CollectionType::iterator Iterator
 

Public Member Functions

 CellPropertyCollection ()
 
void AddProperty (const boost::shared_ptr< AbstractCellProperty > &rProp)
 
CellPropertyRegistryGetCellPropertyRegistry ()
 
void SetCellPropertyRegistry (CellPropertyRegistry *pRegistry)
 
bool HasProperty (const boost::shared_ptr< AbstractCellProperty > &rProp) const
 
template<typename CLASS >
bool HasProperty () const
 
template<typename BASECLASS >
bool HasPropertyType () const
 
template<typename CLASS >
void RemoveProperty ()
 
void RemoveProperty (const boost::shared_ptr< AbstractCellProperty > &rProp)
 
unsigned GetSize () const
 
Iterator Begin ()
 
Iterator End ()
 
boost::shared_ptr< AbstractCellPropertyGetProperty () const
 
template<typename CLASS >
CellPropertyCollection GetProperties () const
 
template<typename BASECLASS >
CellPropertyCollection GetPropertiesType () const
 

Private Types

typedef std::set< boost::shared_ptr< AbstractCellProperty > > CollectionType
 
typedef CollectionType::const_iterator ConstIteratorType
 
typedef CollectionType::iterator IteratorType
 

Private Member Functions

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

Private Attributes

CollectionType mProperties
 
CellPropertyRegistrympCellPropertyRegistry
 

Friends

class boost::serialization::access
 

Detailed Description

Cell property collection class.

Contains methods for accessing and interrogating a set of cell properties.

Definition at line 55 of file CellPropertyCollection.hpp.

Member Typedef Documentation

◆ CollectionType

typedef std::set<boost::shared_ptr<AbstractCellProperty> > CellPropertyCollection::CollectionType
private

The type of container used to store properties

Definition at line 59 of file CellPropertyCollection.hpp.

◆ ConstIteratorType

typedef CollectionType::const_iterator CellPropertyCollection::ConstIteratorType
private

Type of a const iterator over the container

Definition at line 62 of file CellPropertyCollection.hpp.

◆ Iterator

typedef CollectionType::iterator CellPropertyCollection::Iterator

An iterator type over this collection. Don't rely on the particular implementation of the iterator.

Definition at line 191 of file CellPropertyCollection.hpp.

◆ IteratorType

typedef CollectionType::iterator CellPropertyCollection::IteratorType
private

Type of an iterator over the container

Definition at line 65 of file CellPropertyCollection.hpp.

Constructor & Destructor Documentation

◆ CellPropertyCollection()

CellPropertyCollection::CellPropertyCollection ( )

Create an empty collection of cell properties.

Definition at line 38 of file CellPropertyCollection.cpp.

Member Function Documentation

◆ AddProperty()

void CellPropertyCollection::AddProperty ( const boost::shared_ptr< AbstractCellProperty > &  rProp)

Add a new property to this collection.

Parameters
rPropthe property to add

Definition at line 61 of file CellPropertyCollection.cpp.

References EXCEPTION, HasProperty(), and mProperties.

Referenced by Cell::Cell(), Cell::AddCellProperty(), and Cell::Divide().

◆ Begin()

CellPropertyCollection::Iterator CellPropertyCollection::Begin ( )
Returns
an Iterator to the start of this collection.

Definition at line 93 of file CellPropertyCollection.cpp.

References mProperties.

Referenced by Cell::Cell(), Cell::Kill(), and Cell::RemoveCellProperty().

◆ End()

CellPropertyCollection::Iterator CellPropertyCollection::End ( )
Returns
an Iterator to one past the end of this collection.

Definition at line 98 of file CellPropertyCollection.cpp.

References mProperties.

Referenced by Cell::Cell(), Cell::Kill(), and Cell::RemoveCellProperty().

◆ GetCellPropertyRegistry()

CellPropertyRegistry * CellPropertyCollection::GetCellPropertyRegistry ( )
Returns
a pointer to the CellPropertyRegistry (as assigned to this cell in the AbstractCellPopulation constructor).

Definition at line 43 of file CellPropertyCollection.cpp.

References CellPropertyRegistry::Instance(), and mpCellPropertyRegistry.

Referenced by Cell::StartApoptosis().

◆ GetProperties()

◆ GetPropertiesType()

template<typename BASECLASS >
CellPropertyCollection CellPropertyCollection::GetPropertiesType ( ) const
inline
Returns
a sub-collection containing all our properties that are instances of the given class or any of its subclasses.

Definition at line 232 of file CellPropertyCollection.hpp.

References mProperties.

Referenced by Cell::GetAncestor(), Cell::GetCellData(), Cell::GetCellEdgeData(), Cell::GetCellId(), Cell::GetCellProliferativeType(), Cell::GetCellVecData(), Cell::GetMutationState(), and Cell::SetAncestor().

◆ GetProperty()

◆ GetSize()

◆ HasProperty() [1/2]

template<typename CLASS >
bool CellPropertyCollection::HasProperty ( ) const
inline
Returns
whether the collection contains a property that has the exact type CLASS.

Should be used like bool healthy = collection.HasProperty<WildTypeCellMutationState>();

Definition at line 127 of file CellPropertyCollection.hpp.

References mProperties.

Referenced by AddProperty().

◆ HasProperty() [2/2]

bool CellPropertyCollection::HasProperty ( const boost::shared_ptr< AbstractCellProperty > &  rProp) const
Returns
whether this collection contains the given property object.
Parameters
rPropthe property to compare against

Definition at line 70 of file CellPropertyCollection.cpp.

References mProperties.

Referenced by Cell::Cell(), Cell::AddCellProperty(), and Cell::HasCellProperty().

◆ HasPropertyType()

template<typename BASECLASS >
bool CellPropertyCollection::HasPropertyType ( ) const
inline
Returns
whether the collection contains a property that inherits from BASECLASS.

Should be used like collection.HasPropertyType<AbstractCellMutationState>();

Definition at line 146 of file CellPropertyCollection.hpp.

References mProperties.

Referenced by Cell::Cell(), Cell::Divide(), and Cell::HasCellVecData().

◆ RemoveProperty() [1/2]

template<typename CLASS >
void CellPropertyCollection::RemoveProperty ( )
inline

Remove a single property of the given type.

Definition at line 162 of file CellPropertyCollection.hpp.

References EXCEPTION, and mProperties.

Referenced by Cell::Divide(), Cell::RemoveCellProperty(), Cell::SetCellProliferativeType(), and Cell::SetMutationState().

◆ RemoveProperty() [2/2]

void CellPropertyCollection::RemoveProperty ( const boost::shared_ptr< AbstractCellProperty > &  rProp)

Remove the given property from this collection.

Parameters
rPropthe property to remove

Definition at line 75 of file CellPropertyCollection.cpp.

References EXCEPTION, and mProperties.

◆ serialize()

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

Save/load our member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 82 of file CellPropertyCollection.hpp.

References mProperties.

◆ SetCellPropertyRegistry()

void CellPropertyCollection::SetCellPropertyRegistry ( CellPropertyRegistry pRegistry)

Set the CellPropertyRegistry for this cell

Parameters
pRegistryThe cell property registry (assigned in the AbstractCellPopulation constructor).

Definition at line 56 of file CellPropertyCollection.cpp.

References mpCellPropertyRegistry.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 74 of file CellPropertyCollection.hpp.

Member Data Documentation

◆ mpCellPropertyRegistry

CellPropertyRegistry* CellPropertyCollection::mpCellPropertyRegistry
private

Cell property registry.

Definition at line 71 of file CellPropertyCollection.hpp.

Referenced by GetCellPropertyRegistry(), and SetCellPropertyRegistry().

◆ mProperties

CollectionType CellPropertyCollection::mProperties
private

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