[boost-users][statechart] state_machine::initiate()
Hi, Regarding the subj, the reference says: Effects: 1. Calls terminate() ...... 5. Processes all posted events (see process_event()). Returns to the caller if there are no more posted events But on terminate() call, all the posted events are cleared, so initiate() has nothing to process. Thus, I cannot write something like this: output MyMachine::invoke(SomeInput intput) { post_event(EvIput(input)); initiate(); // I want to proceed only after all the input is processed; the states might post internal events return output; } What would be the correct solution for this? Thanks a lot, Igor'.
Ok, I found out what the problem was. Actually, simple process_event() call would do the work, as it returns only after all the posted events are processed.
participants (1)
-
Igor R