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(destination) {}
00013   
00014   //!starts 0 msec timer, so transition will occur very soon
00015   virtual void DoStart() {
00016     Transition::DoStart();
00017     erouter->addTimer(this,0,0,false);
00018   }
00019 
00020   //!stops timer
00021   virtual void DoStop() { erouter->removeListener(this); Transition::DoStop(); }
00022 
00023   //!when timer event is received, fire() the transition
00024   virtual void processEvent(const EventBase&) { fire(); }
00025 
00026   virtual std::string getName() const { return "TimeOutTrans"; }
00027 
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 $
00036  * $Revision: 1.3 $
00037  * $State: Exp $
00038  * $Date: 2004/10/07 19:07:05 $
00039  */
00040 
00041 #endif

Tekkotsu v2.2
Generated Tue Oct 19 14:19:15 2004 by Doxygen 1.3.9.1