Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

NullTrans.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_NullTrans_h_
00003 #define INCLUDED_NullTrans_h_
00004 
00005 #include "Behaviors/Transition.h"
00006 #include "Events/EventRouter.h"
00007 
00008 //! a transition that occurs (via a 0 msec Timer event) as soon as the source node finishes starting up
00009 class NullTrans : public Transition {
00010 public:
00011   //! constructor
00012   NullTrans(StateNode* destination) : Transition("NullTrans",destination) {}
00013   
00014   //! constructor
00015   NullTrans(const std::string& name, StateNode* destination) : 
00016     Transition("NullTrans",name,destination) {}
00017   
00018   //!starts 0 msec timer, so transition will occur very soon
00019   virtual void DoStart() {
00020     Transition::DoStart();
00021     erouter->addTimer(this,0,0,false);
00022   }
00023 
00024   //!stops timer
00025   virtual void DoStop() { erouter->removeListener(this); Transition::DoStop(); }
00026 
00027   //!when timer event is received, fire() the transition
00028   virtual void processEvent(const EventBase&) { fire(); }
00029 
00030 protected:
00031   //! constructor, only to be called by subclasses (which need to specify their own @a classname)
00032   NullTrans(const std::string &classname, const std::string &instancename, 
00033       StateNode* destination) :
00034     Transition(classname,instancename,destination) {}
00035 
00036 };
00037 
00038 /*! @file
00039  * @brief Defines NullTrans, which causes a transition as soon as the source node finishes starting up
00040  * @author dst (Creator)
00041  *
00042  * $Author: ejt $
00043  * $Name: tekkotsu-2_4_1 $
00044  * $Revision: 1.8 $
00045  * $State: Exp $
00046  * $Date: 2004/12/23 01:47:07 $
00047  */
00048 
00049 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:48 2005 by Doxygen 1.4.4