#ifndef __FSM__ #define __FSM__ #include using namespace std; // This is a state machine implement in cpp template template class StateMachine{ public: StateMachine(){ std::cout<<"call first"; } virtual void SetStateLink(){ return; } virtual int UpdateState(T2){ return -100; }; //update a state T1 CurrentState(){ return -100; } protected: T1 mState; }; #endif