[MPL Book] FSM Question

I have a question on the FSM Player from the MPL book. In the source sample you write in the main function: player p; // An instance of the FSM p.process_event(open_close()); // user opens CD player p.process_event(open_close()); // inserts CD and closes p.process_event( // CD is detected cd_detected( "louie, louie" , std::vectorstd::clock_t( /* track lengths */ ) ) ); p.process_event(play()); // etc. p.process_event(pause()); p.process_event(play()); p.process_event(stop()); This is nice but what if I have a real life case, where I don't know which event will arrive next? Then I need to dispatch the incoming event and convert it to the appropriate tag. Do I misunderstand it? When I read the book it seemed clear to me, but now I am in the situation where I could use it and I have doubts if I really understood it the way the authors thought... With Kind Regards, Ovanes
participants (1)
-
Ovanes Markarian