appkit  1.5.1
RoadNarrows Robotics Application Kit
StateA Class Reference

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

Inheritance diagram for StateA:
State2_3Turing StateKb

Public Member Functions

 StateA ()
 Constuctor.
 
virtual ~StateA ()
 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 A.

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

Member Function Documentation

virtual int StateA::receiveEvent ( )
inlinevirtual

Receive the next event.

Returns
Event id.

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

References EventIdPauseResume, EventIdRestart, and EventIdTerminate.

582  {
583  int nEventId;
584 
585  nEventId = StateKb::receiveEvent();
586 
587  switch( nEventId )
588  {
589  case EventIdPauseResume:
590  case EventIdRestart:
591  case EventIdTerminate:
592  return nEventId;
593  case KbEventTimeOut:
594  return readSymbol();
595  default:
596  return '?'; // force default action == this state
597  }
598  }
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: