|
Boost : |
From: Leandro Lucarella (llucarella_at_[hidden])
Date: 2007-08-31 13:04:46
Andreas Huber wrote:
>> struct ev: sc::event< ev > {};
>> struct B;
>> struct C;
>> struct A: sc::simple_state< A, Machine >
>> {
>> typedef mpl::list<
>> sc::completion_transition< >,
>> sc::custom_reaction< ev >
>> > reactions;
>> sc::result react(const completion_event&)
>> {
>> if (guard)
>> return transit< B >();
>> return discard_event();
>> }
>> sc::result react(const ev&)
>> {
>> if (!guard)
>> return transit< C >();
>> return discard_event();
>> }
>> };
>
> I'm not sure how this is an improvement over the choice-point-like
> class?
It improves readability and removes the need for a dummy intermediate class?
> Again, this limitation can be overcome easily with the same trick.
> Specify a dummy outermost state as initial state and then post an event in the
> entry action that will trigger a transition to the desired state.
Ok, my main problem is gone. I can now express what I need with the
intermediate dummy state trick.
I think the improvements in this limitations are desirable but not
critical, and maybe you are right and it's too much work for too little
gain.
Thanks for your help!
-- Leandro Lucarella Integratech S.A. 4571-5252
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk