CellPropertyCollection Class Reference

#include <CellPropertyCollection.hpp>

Collaboration diagram for CellPropertyCollection:
Collaboration graph
[legend]

List of all members.

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
< AbstractCellProperty
GetProperty () 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 48 of file CellPropertyCollection.hpp.


Member Typedef Documentation

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

The type of container used to store properties

Definition at line 52 of file CellPropertyCollection.hpp.

typedef CollectionType::const_iterator CellPropertyCollection::ConstIteratorType [private]

Type of a const iterator over the container

Definition at line 55 of file CellPropertyCollection.hpp.

typedef CollectionType::iterator CellPropertyCollection::Iterator

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

Definition at line 184 of file CellPropertyCollection.hpp.

typedef CollectionType::iterator CellPropertyCollection::IteratorType [private]

Type of an iterator over the container

Definition at line 58 of file CellPropertyCollection.hpp.


Constructor & Destructor Documentation

CellPropertyCollection::CellPropertyCollection (  ) 

Create an empty collection of cell properties.

Definition at line 31 of file CellPropertyCollection.cpp.


Member Function Documentation

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

Add a new property to this collection.

Parameters:
rProp the property to add

Definition at line 54 of file CellPropertyCollection.cpp.

References EXCEPTION, HasProperty(), and mProperties.

Referenced by Cell::AddCellProperty(), Cell::Cell(), GetProperties(), and GetPropertiesType().

CellPropertyCollection::Iterator CellPropertyCollection::Begin (  ) 

Get an Iterator to the start of this collection.

Definition at line 86 of file CellPropertyCollection.cpp.

References mProperties.

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

CellPropertyCollection::Iterator CellPropertyCollection::End (  ) 

Get an Iterator to one past the end of this collection.

Definition at line 91 of file CellPropertyCollection.cpp.

References mProperties.

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

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

Definition at line 36 of file CellPropertyCollection.cpp.

References CellPropertyRegistry::Instance(), and mpCellPropertyRegistry.

Referenced by Cell::StartApoptosis().

template<typename CLASS >
CellPropertyCollection CellPropertyCollection::GetProperties (  )  const [inline]

Get a sub-collection containing all our properties that are instances of the given class.

Definition at line 207 of file CellPropertyCollection.hpp.

References AddProperty(), and mProperties.

template<typename BASECLASS >
CellPropertyCollection CellPropertyCollection::GetPropertiesType (  )  const [inline]

Get a sub-collection containing all our properties that are instances of the given class or any of its subclasses.

Definition at line 225 of file CellPropertyCollection.hpp.

References AddProperty(), and mProperties.

Referenced by Cell::GetMutationState().

boost::shared_ptr< AbstractCellProperty > CellPropertyCollection::GetProperty (  )  const

If this collection contains a single property, then return it. Otherwise, throws an exception.

Definition at line 96 of file CellPropertyCollection.cpp.

References EXCEPTION, GetSize(), and mProperties.

Referenced by AbstractCellPopulation< DIM >::GenerateCellResults(), Cell::GetMutationState(), and PottsBasedCellPopulation< DIM >::WriteVtkResultsToFile().

unsigned CellPropertyCollection::GetSize (  )  const

Get the size of this container.

Definition at line 81 of file CellPropertyCollection.cpp.

References mProperties.

Referenced by Cell::GetMutationState(), and GetProperty().

template<typename CLASS >
bool CellPropertyCollection::HasProperty (  )  const [inline]

Test whether the collection contains a property that has the exact type CLASS.

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

Definition at line 120 of file CellPropertyCollection.hpp.

References mProperties.

Referenced by AddProperty().

bool CellPropertyCollection::HasProperty ( const boost::shared_ptr< AbstractCellProperty > &  rProp  )  const

Test whether this collection contains the given property object.

Parameters:
rProp the property to compare against

Definition at line 63 of file CellPropertyCollection.cpp.

References mProperties.

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

template<typename BASECLASS >
bool CellPropertyCollection::HasPropertyType (  )  const [inline]

Test whether the collection contains a property that inherits from BASECLASS.

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

Definition at line 139 of file CellPropertyCollection.hpp.

References mProperties.

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

Remove the given property from this collection.

Parameters:
rProp the property to remove

Definition at line 68 of file CellPropertyCollection.cpp.

References EXCEPTION, and mProperties.

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

Remove a property of the given type.

Definition at line 155 of file CellPropertyCollection.hpp.

References EXCEPTION, and mProperties.

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

template<class Archive >
void CellPropertyCollection::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

We don't have any member variables yet, but let's make things easy for the future.

Parameters:
archive the archive
version the current version of this class

Definition at line 75 of file CellPropertyCollection.hpp.

References mProperties.

void CellPropertyCollection::SetCellPropertyRegistry ( CellPropertyRegistry pRegistry  ) 

Set the CellPropertyRegistry for this cell

Parameters:
pRegistry The cell property registry (assigned in the AbstractCellPopulation constructor).

Definition at line 49 of file CellPropertyCollection.cpp.

References mpCellPropertyRegistry.


Friends And Related Function Documentation

friend class boost::serialization::access [friend]

Needed for serialization.

Definition at line 67 of file CellPropertyCollection.hpp.


Member Data Documentation

Cell property registry.

Definition at line 64 of file CellPropertyCollection.hpp.

Referenced by GetCellPropertyRegistry(), and SetCellPropertyRegistry().

The properties stored in this collection.

Definition at line 61 of file CellPropertyCollection.hpp.

Referenced by AddProperty(), Begin(), End(), GetProperties(), GetPropertiesType(), GetProperty(), GetSize(), HasProperty(), HasPropertyType(), RemoveProperty(), and serialize().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:03:26 2011 for Chaste by  doxygen 1.6.3