39 #include <boost/utility.hpp> 40 #include <boost/shared_ptr.hpp> 41 #include <boost/enable_shared_from_this.hpp> 44 #include <boost/serialization/shared_ptr.hpp> 46 #include "AbstractCellMutationState.hpp" 47 #include "AbstractCellProliferativeType.hpp" 48 #include "CellData.hpp" 49 #include "CellVecData.hpp" 51 #include "AbstractCellCycleModel.hpp" 52 #include "AbstractSrnModel.hpp" 53 #include "CellPropertyCollection.hpp" 60 typedef boost::shared_ptr<Cell> CellPtr;
89 class Cell :
private boost::noncopyable,
public boost::enable_shared_from_this<Cell>
97 friend class boost::serialization::access;
104 template<
class Archive>
105 void serialize(Archive & archive,
const unsigned int version)
108 archive & mCanDivide;
109 archive & mpCellCycleModel;
110 archive & mpSrnModel;
111 archive & mUndergoingApoptosis;
112 archive & mDeathTime;
113 archive & mStartOfApoptosisTime;
114 archive & mApoptosisTime;
165 Cell(boost::shared_ptr<AbstractCellProperty> pMutationState,
168 bool archiving=
false,
179 boost::shared_ptr<AbstractCellProliferativeType> GetCellProliferativeType()
const;
186 void SetCellProliferativeType(boost::shared_ptr<AbstractCellProperty> pProliferativeType);
193 void SetBirthTime(
double birthTime);
210 void InitialiseCellCycleModel();
227 void InitialiseSrnModel();
232 double GetAge()
const;
237 double GetBirthTime()
const;
242 double GetStartOfApoptosisTime()
const;
247 double GetApoptosisTime()
const;
254 void SetApoptosisTime(
double apoptosisTime);
259 boost::shared_ptr<AbstractCellMutationState> GetMutationState()
const;
266 boost::shared_ptr<CellData> GetCellData()
const;
273 bool HasCellVecData()
const;
280 boost::shared_ptr<CellVecData> GetCellVecData()
const;
287 void SetMutationState(boost::shared_ptr<AbstractCellProperty> pMutationState);
307 void AddCellProperty(
const boost::shared_ptr<AbstractCellProperty>& rProperty);
316 template<
typename CLASS>
319 bool cell_has_property =
false;
321 for (std::set<boost::shared_ptr<AbstractCellProperty> >::iterator property_iter = mCellPropertyCollection.
Begin();
322 property_iter != mCellPropertyCollection.
End();
325 if ((*property_iter)->IsType<CLASS>())
327 cell_has_property =
true;
328 (*property_iter)->DecrementCellCount();
333 if (cell_has_property)
343 template<
typename CLASS>
346 return mCellPropertyCollection.
HasProperty<CLASS>();
353 bool ReadyToDivide();
369 void StartApoptosis(
bool setDeathTime=
true);
380 bool HasApoptosisBegun()
const;
385 double GetTimeUntilDeath()
const;
407 void SetAncestor(boost::shared_ptr<AbstractCellProperty> pCellAncestor);
413 unsigned GetAncestor()
const;
418 unsigned GetCellId()
const;
427 namespace serialization
432 template<
class Archive>
433 inline void save_construct_data(
434 Archive & ar,
const Cell * t,
const unsigned int file_version)
437 const boost::shared_ptr<AbstractCellMutationState> p_mutation_state = t->
GetMutationState();
438 ar & p_mutation_state;
441 ar & p_cell_cycle_model;
447 ar & r_cell_property_collection;
453 template<
class Archive>
454 inline void load_construct_data(
455 Archive & ar,
Cell * t,
const unsigned int file_version)
458 boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
459 ar & p_mutation_state;
462 ar & p_cell_cycle_model;
467 bool archiving =
true;
470 ar & cell_property_collection;
473 ::new(t)
Cell(p_mutation_state, p_cell_cycle_model, p_srn_model, archiving, cell_property_collection);
AbstractCellCycleModel * GetCellCycleModel() const
void serialize(Archive &archive, const unsigned int version)
AbstractSrnModel * mpSrnModel
void operator()(void const *) const
bool mUndergoingApoptosis
CellPropertyCollection & rGetCellPropertyCollection()
AbstractCellCycleModel * mpCellCycleModel
AbstractSrnModel * GetSrnModel() const
bool HasProperty(const boost::shared_ptr< AbstractCellProperty > &rProp) const
CellPropertyCollection mCellPropertyCollection
#define CHASTE_CLASS_EXPORT(T)
double mStartOfApoptosisTime
void RemoveCellProperty()
gcov doesn't like this file...
bool HasCellProperty() const
boost::shared_ptr< AbstractCellMutationState > GetMutationState() const