Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PilotTrans.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_PilotTrans_h_
00003 #define INCLUDED_PilotTrans_h_
00004 
00005 #include "Behaviors/Transition.h"
00006 #include "Events/PilotEvent.h"
00007 #include "Events/EventRouter.h"
00008 #include "Crew/PilotTypes.h"
00009 
00010 //! Causes a transition if a PilotEvent from pilotEGID occurs, and checks for a specific error value if one is supplied.
00011 /*! This allows a PilotNode to signal a transition to another state
00012  *  in a clean symbolic way.  Only the transition itself needs to
00013  *  know the address of the destination node.  The PilotEvent
00014  *  will be supplied to the destination node's doStart() method.
00015  */
00016 
00017 class PilotTrans : public Transition {
00018 public:
00019   //! Constructor
00020   PilotTrans(StateNode *destination) :
00021     Transition(destination), errorType(), valueSupplied(false), savedEvent() {}
00022 
00023   //! Constructor
00024   PilotTrans(StateNode *destination, DualCoding::PilotTypes::ErrorType_t value) :
00025     Transition(destination), errorType(value), valueSupplied(true), savedEvent() {}
00026 
00027   //! Constructor
00028   PilotTrans(const std::string &name, StateNode *destination) :
00029     Transition(name,destination), errorType(), valueSupplied(false), savedEvent() {}
00030 
00031   //! Constructor
00032   PilotTrans(const std::string &name, StateNode *destination, DualCoding::PilotTypes::ErrorType_t value) :
00033     Transition(name,destination), errorType(value), valueSupplied(true), savedEvent() {}
00034 
00035   //! Copy constructor
00036   PilotTrans(const PilotTrans &src);
00037   
00038   virtual void postStart();
00039   virtual void doEvent();
00040 
00041 protected:
00042   DualCoding::PilotTypes::ErrorType_t errorType; //!< value to compare against
00043   bool valueSupplied;  //!< true if a value was supplied in the constructor
00044   PilotEvent savedEvent;
00045 
00046 private:
00047   PilotTrans& operator=(const PilotTrans& src);  //!< don't call this
00048 
00049 };
00050 
00051 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:46 2016 by Doxygen 1.6.3