1: // Implementation of methods for class rs_ff_session.  05/26/98
  2: // rj@elilabs.com

  4: #include "rs_ff_session.H"
  5: #include "rs_ff_state.H"

  7: rs_ff_session::rs_ff_session(rs_ff_state* initial_state) // this is the only valid constructor
  8:   : current_state(initial_state) {
  9:   entry_action();
 10: }


 13: // Do this when we enter a new state
 14: //
 15: void rs_ff_session::entry_action(void) {
 16:   current_state->entry_action(this);        // do the current state's entry_action
 17:   return;
 18: }


 21: // event handlers

 23: // event S
 24: //
 25: void rs_ff_session::S(void) {
 26:   if (!current_state->S__guard(this)) return;
 27:   current_state->S__exit_action(this);
 28:   current_state = current_state->S__next_state();
 29:   entry_action();
 30:   return;
 31: }

 33: // event Sbar
 34: //
 35: void rs_ff_session::Sbar(void) {
 36:   if (!current_state->Sbar__guard(this)) return;
 37:   current_state->Sbar__exit_action(this);
 38:   current_state = current_state->Sbar__next_state();
 39:   entry_action();
 40:   return;
 41: }

 43: // event R
 44: //
 45: void rs_ff_session::R(void) {
 46:   if (!current_state->R__guard(this)) return;
 47:   current_state->R__exit_action(this);
 48:   current_state = current_state->R__next_state();
 49:   entry_action();
 50:   return;
 51: }

 53: // event Rbar
 54: //
 55: void rs_ff_session::Rbar(void) {
 56:   if (!current_state->Rbar__guard(this)) return;
 57:   current_state->Rbar__exit_action(this);
 58:   current_state = current_state->Rbar__next_state();
 59:   entry_action();
 60:   return;
 61: }