Boost logo

Boost Users :

From: Igor R (boost.lists_at_[hidden])
Date: 2008-05-26 13:26:53


Hello,

Just a few more questions about the subj :)

1. IIUC, in async_state_machine it's impossible to post an "internal"
event from a state by calling queue_event(), as noone will actually
call process_event(). Instead, it should be always done through the
processor queue, like this:
  outermost_context_type &machine = outermost_context();
  machine.my_scheduler().queue_event(machine.my_handle(), MyEvent());
Am I right?

2. Deferred events in async.machine. Say, we've got the following
states (simplified code):

struct State1 : simple_state<...>
{
  typedef transition<EvGotoState2, State2> reactions;
};

struct State2 : simple_state<...>
{
  typedef mpl::list
  <
    transition<EvGotoState1, State1>,
    deferral<EvGotoState2>
>
  reactions;
};

Both events are queued to the machine from the "outer world".
* We're already in State2.
* We get a bunch of EvGotoState2 posted (eg., 10 events). All of them
are queued to the state's deferred events queue.
* EvGotoState1 comes. The machine goes to State1 and then immediately
consumes 1 deferred EvGotoState2 and move to State2. What happens to
the rest of the deferred events? Are they queued again to the deferral
queue of State2?

3. Is it possible to clear all the deferred events? Is it possible to
clear deferred events of a specific type? Eg., in State2 I'd like to
alway defer only the *last* EvGotoState2, discarding all the previous
deferred events of this type. Is it possible?

Thanks a lot!

Igor'.


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