Homepage Demos Overview Downloads Tutorials 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) : Transition("NullTrans",name,destination) {}
00016   
00017   //!starts 0 msec timer, so transition will occur very soon
00018   virtual void DoStart() {
00019     Transition::DoStart();
00020     erouter->addTimer(this,0,0,false);
00021   }
00022 
00023   //!stops timer
00024   virtual void DoStop() { erouter->removeListener(this); Transition::DoStop(); }
00025 
00026   //!when timer event is received, fire() the transition
00027   virtual void processEvent(const EventBase&) { fire(); }
00028 };
00029 
00030 /*! @file
00031  * @brief Defines NullTrans, which causes a transition as soon as the source node finishes starting up
00032  * @author dst (Creator)
00033  *
00034  * $Author: ejt $
00035  * $Name: tekkotsu-2_2_1 $
00036  * $Revision: 1.5 $
00037  * $State: Exp $
00038  * $Date: 2004/11/15 22:46:19 $
00039  */
00040 
00041 #endif

Tekkotsu v2.2.1
Generated Tue Nov 23 16:36:39 2004 by Doxygen 1.3.9.1