1: // This is the definition of a state object in a state graph.  05/25/98 rj@elilabs.com

  3: #ifndef __state__H__
  4: #define __state__H__

  6: class session;

  8: class state {

 10: public:

 12:   state() {                                // constructor
 13:   }

 15:   virtual ~state() {                        // Destructor
 16:   }


 19:   // Typical entry action.
 20:   //
 21:   //  virtual void entry_action(session* current_session);


 24:   // Typical event handler sub-methods associated with this state.
 25:   //
 26:   //  virtual boolean foo__guard(session* current_session, blatz* boz, float zot) {
 27:   //
 28:   //    boolean whatever;
 29:   //
 30:   //    // Do whatever is needed to determine whether to return TRUE or FALSE.
 31:   //    // In particular, hard coded "return TRUE;" and "return FALSE;" are
 32:   //    // both valid and meaningful and very useful here.
 33:   //
 34:   //    return whatever;
 35:   //  }
 36:   //
 37:   //
 38:   //  virtual bar* foo__exit_action(session* current_session, blatz* boz, float zot) {
 39:   //
 40:   //    bar* return_value;
 41:   //
 42:   //    // perform exit action and return appropriatly...
 43:   //
 44:   //    return return_value;
 45:   //  }
 46:   //
 47:   //
 48:   //  // This is implemented as a function to provide write protection!
 49:   //  state* foo__next;                        // foo__next is filled in by the code generator.
 50:   //  virtual state* foo__next_state(void) {
 51:   //    return foo_next;
 52:   //  }

 54: };

 56: #endif // __state__H__