#include #include #include #include #include #include #include #include class StateMachine; class SuperState; namespace boost { namespace statechart { template<> inline void asynchronous_state_machine::initiate_impl() {} }} class StateMachine: public boost::statechart::asynchronous_state_machine { public: StateMachine(my_context ctx) : my_base(ctx) {} private: virtual void initiate_impl(); }; class SubState; //MODIFICATION 1 of 3: UNCOMMENT THE FOLLOWING LINE class SuperState: public boost::statechart::simple_state { //MODIFICATION 2 of 3: COMMENT OUT THE FOLLOWING LINE //class SuperState: public boost::statechart::simple_state { public: SuperState(){ std::cout<<"Entered into SuperState."< { public: SubState(){ std::cout<<"Entered into SubState."<::initiate(); } int main() { std::cout<<"\n\nPress any key and then to exit\n\n"< scheduler(true); boost::statechart::fifo_scheduler<>::processor_handle handle = scheduler.create_processor (); scheduler.initiate_processor(handle); boost::thread aThread(boost::bind(&boost::statechart::fifo_scheduler<>::operator(),&scheduler, 0)); std::cin >> key; scheduler.destroy_processor(handle); scheduler.terminate(); aThread.join(); return 0; }