Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2007-03-29 14:38:57


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::vector<std::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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net