Boost logo

Boost Users :

Subject: [Boost-users] Boost msm
From: keithzz (keithzz_at_[hidden])
Date: 2012-03-04 20:22:19


newbi question pleasee bare with me as Im struggling with this.

I want to use boost msm state machine but i am having a hard time imagining
how it works. Let say we only have 2 states (s1, s2) and to go from s1 to s2
you need event e1 to be fired and to bo back you need another one e2. e1 and
e2 can only be fired from within s1 and s2 respectively.

Now in main() I start by starting the statemachine (start()) then ill have a
while loop that every 1 min will go back to the state machine but have to
pick up from where it left.i.e.

main()
{
    MSM.start(); //start state machine

    while (a_condition)
    {
         ProcessInputsfromIO();
         Go_backtoStatemachine(); //how can i do this?
         delay(1min)
     }
      MSM.stop();
}
So basically when a state finishes executing, the statemachine will exit,
then ill have a delay of 1 minutes, then the while loop will need to take me
back to the state I was before I exit, or I think that's how we should
implement a state machine.

Is what I am asking for out of the ordinary? If yes then how do people
implement a non-blocking state machine? if no, then how can I implement
Go_backtoStatemachine()?

--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-msm-tp4444830p4444830.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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