SloughingCellKiller.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2009
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 #ifndef SLOUGHINGCELLKILLER_HPP_
00029 #define SLOUGHINGCELLKILLER_HPP_
00030 
00031 #include "AbstractCellKiller.hpp"
00032 
00033 #include <boost/serialization/access.hpp>
00034 #include <boost/serialization/base_object.hpp>
00035 
00044 template<unsigned DIM>
00045 class SloughingCellKiller : public AbstractCellKiller<DIM>
00046 {
00047 private:
00048 
00050     bool mSloughSides;
00051 
00053     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         //archive & mSloughSides; // done in load_construct_data
00070 
00071         // Make sure Tissue configuration archived
00072         TissueConfig *p_config = TissueConfig::Instance();
00073         archive & *p_config;
00074         archive & p_config;
00075     }
00076 
00077 public:
00078 
00085     SloughingCellKiller(AbstractTissue<DIM>* pCrypt, bool sloughSides=false);
00086 
00090     bool GetSloughSides() const;
00091 
00095     virtual void TestAndLabelCellsForApoptosisOrDeath();
00096 
00097 };
00098 
00099 #include "TemplatedExport.hpp"
00100 EXPORT_TEMPLATE_CLASS_SAME_DIMS(SloughingCellKiller)
00101 
00102 namespace boost
00103 {
00104 namespace serialization
00105 {
00109 template<class Archive, unsigned DIM>
00110 inline void save_construct_data(
00111     Archive & ar, const SloughingCellKiller<DIM> * t, const BOOST_PFTO unsigned int file_version)
00112 {
00113     // Save data required to construct instance
00114     const AbstractTissue<DIM>* const p_crypt = t->GetTissue();
00115     ar << p_crypt;
00116     bool slough_sides = t->GetSloughSides();
00117     ar << slough_sides;
00118 }
00119 
00123 template<class Archive, unsigned DIM>
00124 inline void load_construct_data(
00125     Archive & ar, SloughingCellKiller<DIM> * t, const unsigned int file_version)
00126 {
00127     // Retrieve data from archive required to construct new instance
00128     AbstractTissue<DIM> *p_crypt;
00129     ar >> p_crypt;
00130     bool slough_sides;
00131     ar >> slough_sides;
00132 
00133     // Invoke inplace constructor to initialise instance
00134     ::new(t)SloughingCellKiller<DIM>(p_crypt, slough_sides);
00135 }
00136 }
00137 } // namespace ...
00138 
00139 #endif /*SLOUGHINGCELLKILLER_HPP_*/

Generated on Tue Aug 4 16:10:21 2009 for Chaste by  doxygen 1.5.5