PassiveStepper.hpp

Go to the documentation of this file.
00001 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00002 //
00003 //        This file is part of E-Cell Simulation Environment package
00004 //
00005 //                Copyright (C) 1996-2002 Keio University
00006 //
00007 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00008 //
00009 //
00010 // E-Cell is free software; you can redistribute it and/or
00011 // modify it under the terms of the GNU General Public
00012 // License as published by the Free Software Foundation; either
00013 // version 2 of the License, or (at your option) any later version.
00014 // 
00015 // E-Cell is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018 // See the GNU General Public License for more details.
00019 // 
00020 // You should have received a copy of the GNU General Public
00021 // License along with E-Cell -- see the file COPYING.
00022 // If not, write to the Free Software Foundation, Inc.,
00023 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00024 // 
00025 //END_HEADER
00026 //
00027 // written by Koichi Takahashi <shafi@e-cell.org>,
00028 // E-Cell Project.
00029 //
00030 
00031 #ifndef __PASSIVESTEPPER_HPP
00032 #define __PASSIVESTEPPER_HPP
00033 
00034 #include "libecs.hpp"
00035 
00036 #include "Stepper.hpp"
00037 
00038 
00039 namespace libecs
00040 {
00041 
00042   /** @addtogroup stepper
00043    *@{
00044    */
00045 
00046   /** @file */
00047 
00048 
00049   /**
00050      PassiveStepper steps only when triggered by incoming interruptions from
00051      other Steppers.
00052 
00053      Note that this Stepper DOES dispatch interruptions to other Steppers
00054      when it steps.
00055 
00056      The step interval of this Stepper is usually infinity -- which
00057      means that this doesn't step spontaneously.  However, when
00058      interrupted by another Stepper, the step interval will be
00059      set zero, and this Stepper will step immediately after the
00060      currently stepping Stepper, at the same time point.
00061 
00062   */
00063 
00064   LIBECS_DM_CLASS( PassiveStepper, Stepper )
00065   {
00066 
00067   public:
00068 
00069     LIBECS_DM_OBJECT( PassiveStepper, Stepper )
00070       {
00071         INHERIT_PROPERTIES( Stepper );
00072       }
00073 
00074 
00075     PassiveStepper();
00076     ~PassiveStepper() {}
00077     
00078     virtual void initialize();
00079 
00080     virtual void step()
00081     {
00082       fireProcesses();
00083 
00084       setStepInterval( INF );
00085     }
00086 
00087     virtual void interrupt( TimeParam aTime )
00088     {
00089       setCurrentTime( aTime );
00090       setStepInterval( 0.0 );
00091     }
00092 
00093     virtual SET_METHOD( Real, StepInterval )
00094     {
00095       // skip range check
00096       loadStepInterval( value );
00097     }
00098 
00099 
00100   };
00101 
00102 
00103 } // namespace libecs
00104 
00105 #endif /* __PASSIVESTEPPER_HPP */
00106 
00107 
00108 
00109 /*
00110   Do not modify
00111   $Author: shafi $
00112   $Revision: 2540 $
00113   $Date: 2005-12-19 05:40:56 +0100 (Mon, 19 Dec 2005) $
00114   $Locker$
00115 */

Generated on Mon Dec 18 07:24:07 2006 for E-CELL C++ libraries (libecs and libemc) 3.1.105 by  doxygen 1.5.1