Boost logo

Boost Users :

Subject: Re: [Boost-users] boost statechart - using deep_history/shallow_history with custom reactions
From: ae ss (aess76_at_[hidden])
Date: 2009-11-16 04:56:26


Hi Andreas

that worked perfectly! thanks!

Just so that I understand the mechanism, basically I have to transit
into the initial state child-state-A1 , and deep_history will know
that it actually needs to go through child-state-A2 on its way there.
correct?

regards
silva

>Hi

>> the documentation shows how to do it with sc::transition... but I couldn't
>> find a way to do it in the case of custom reactions
>> trial and error didn't work either...

>Did you try return transit< sc::deep_history< child-state-A1 > >() ?
>Regards,
>--
>Andreas Huber

On Fri, Nov 13, 2009 at 10:41 PM, ae ss <aess76_at_[hidden]> wrote:
>
> Hi
>
> Question on using history with custom reactions
>
> I have a parent-state-A state and a parent-state-B state
>
> parent-state-A has a child-state-A1 and a child-state-A2 (nested state)
>
> The machine initializes on parent-state-A entering by default in child-state-A1 (the initial state)
> Then moves to child-state-A2
> Then to parent-state-B
>
> Then a event occurs and I need the machine to go back to child-state-A2 (and not the initial state child-state-A2)
>
> question is how do I do it when using custom reactions
> that is, instead of doing a hardcoded
>
> parent-state-B::react (event& evty)
> {
>     return transit<child-state-A2 > ();
> }
>
> I would like to do something like
>
> parent-state-B::react (event& evty)
> {
>     return transit<parent-state-A > ();
> }
>
> and let the state machine figure out that it needs to go back to child-state-A2 rather then the initial child-state-A1
>
> the documentation shows how to do it with sc::transition... but I couldn't find a way to do it in the case of custom reactions
> trial and error didn't work either...
>
> help! : )
>
> thanks in advance
> silva
>
>


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