appkit  1.5.1
RoadNarrows Robotics Application Kit
StateB Class Reference

(2,3) Turing Machine's state B. More...

Inheritance diagram for StateB:
State2_3Turing StateKb

Public Member Functions

 StateB ()
 Constuctor.
 
virtual ~StateB ()
 Destructor.
 
virtual int receiveEvent ()
 Receive the next event. More...
 
- Public Member Functions inherited from State2_3Turing
 State2_3Turing (int nStateId, const std::string &strStateName="", const std::string &strRefTag="")
 Initializatoin constuctor. More...
 
virtual ~State2_3Turing ()
 Destructor.
 
int readSymbol ()
 
void writeSymbol (int sym)
 
void moveHeadLeft ()
 Move head left one position on the tape.
 
void moveHeadRight ()
 Move head right one position on the tape.
 
void showTape ()
 Show colorized tape to stdout.
 

Additional Inherited Members

- Static Public Attributes inherited from State2_3Turing
static vector< int > Tape
 the tape of symbols More...
 
static int Head
 the tape read/write head
 

Detailed Description

(2,3) Turing Machine's state B.

Definition at line 747 of file ut-sm.cxx.

Member Function Documentation

virtual int StateB::receiveEvent ( )
inlinevirtual

Receive the next event.

Returns
Event id.

Definition at line 773 of file ut-sm.cxx.

References EventIdPauseResume, EventIdRestart, and EventIdTerminate.

774  {
775  int nEventId;
776 
777  nEventId = StateKb::receiveEvent();
778 
779  switch( nEventId )
780  {
781  case EventIdPauseResume:
782  case EventIdRestart:
783  case EventIdTerminate:
784  return nEventId;
785  case KbEventTimeOut:
786  return readSymbol();
787  default:
788  return '?'; // force default action == this state
789  }
790  }
static const int EventIdTerminate
terminate event id
Definition: ut-sm.cxx:85
static const int EventIdPauseResume
pause/resume event id
Definition: ut-sm.cxx:84
static const int EventIdRestart
restart event id
Definition: ut-sm.cxx:86

The documentation for this class was generated from the following file: