00001 // Copyright (C) 2007 University of Louisiana at Lafayette 00002 // Authors: Suresh Golconda 00003 00004 #ifndef CAJUN_BASE_STATE_MACHINE_H 00005 #define CAJUN_BASE_STATE_MACHINE_H 00006 00007 #include "state_defs.H" 00008 #include "state_machine.H" 00009 00010 #include <string> 00011 00012 namespace cajun 00013 { 00014 class state_machine_t; 00015 class base_state_machine_t 00016 { 00017 protected: 00018 state_machine_id_t m_state_id; // Label of the state 00019 double m_tstamp_since; // tstamp since in this state 00020 std::string m_name; // Name of the state 00021 public: 00024 virtual state_machine_id_t new_state (state_machine_t *sm_) = 0; 00025 00028 virtual bool update (state_machine_t *sm_) { return true;} 00029 00031 state_machine_id_t get_id () { return m_state_id; } 00032 00034 std::string get_name () { return m_name; } 00035 00036 virtual ~base_state_machine_t () { }; 00037 }; 00038 }; 00039 00040 00041 #endif
1.6.1