TargetedCellKiller.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef TARGETEDCELLKILLER_HPP_
00030 #define TARGETEDCELLKILLER_HPP_
00031
00032 #include "AbstractCellKiller.hpp"
00033
00034 #include "ChasteSerialization.hpp"
00035 #include <boost/serialization/base_object.hpp>
00036
00041 template<unsigned DIM>
00042 class TargetedCellKiller : public AbstractCellKiller<DIM>
00043 {
00044 private:
00045
00049 unsigned mTargetIndex;
00050
00055 bool mBloodLust;
00056
00058 friend class boost::serialization::access;
00065 template<class Archive>
00066 void serialize(Archive & archive, const unsigned int version)
00067 {
00068 archive & boost::serialization::base_object<AbstractCellKiller<DIM> >(*this);
00069
00070
00071 }
00072
00073 public:
00074
00082 TargetedCellKiller(AbstractCellPopulation<DIM>* pCellPopulation, unsigned targetedIndex, bool bloodLust = true);
00083
00087 unsigned GetTargetIndex() const;
00088
00092 unsigned GetBloodLust() const;
00093
00098 void TestAndLabelCellsForApoptosisOrDeath();
00099
00105 void OutputCellKillerParameters(out_stream& rParamsFile);
00106 };
00107
00108 #include "SerializationExportWrapper.hpp"
00109 EXPORT_TEMPLATE_CLASS_SAME_DIMS(TargetedCellKiller)
00110
00111 namespace boost
00112 {
00113 namespace serialization
00114 {
00118 template<class Archive, unsigned DIM>
00119 inline void save_construct_data(
00120 Archive & ar, const TargetedCellKiller<DIM> * t, const BOOST_PFTO unsigned int file_version)
00121 {
00122
00123 const AbstractCellPopulation<DIM>* const p_cell_population = t->GetCellPopulation();
00124 ar << p_cell_population;
00125 unsigned targeted_index = t->GetTargetIndex();
00126 ar << targeted_index;
00127 bool blood_lust = t->GetBloodLust();
00128 ar << blood_lust;
00129 }
00130
00134 template<class Archive, unsigned DIM>
00135 inline void load_construct_data(
00136 Archive & ar, TargetedCellKiller<DIM> * t, const unsigned int file_version)
00137 {
00138
00139 AbstractCellPopulation<DIM>* p_cell_population;
00140 ar >> p_cell_population;
00141 unsigned targeted_index;
00142 ar >> targeted_index;
00143 bool blood_lust;
00144 ar >> blood_lust;
00145
00146
00147 ::new(t)TargetedCellKiller<DIM>(p_cell_population, targeted_index, blood_lust);
00148 }
00149 }
00150 }
00151
00152 #endif