Boost logo

Boost Users :

Subject: [Boost-users] boost statechart - using deep_history/shallow_history with custom reactions
From: ae ss (aess76_at_[hidden])
Date: 2009-11-13 17:41:46


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