|
Boost Users : |
Subject: Re: [Boost-users] Boost MSM - Ways to send info out from state machine to outside world
From: gauravk (gaurav_kulkarni_at_[hidden])
Date: 2011-09-08 20:52:03
Hi,
I had one more question about the lifetime of the FSM. When does the state
machine die? I was expecting that the state machine has to be explicitly
killed (similar to fsm's start() method). But from whatever I have figured
out, I think the state machine dies if it is in a state and no event occurs.
If that is true, what will be an elegant way to "wait" inside a state till
some event occurs (i.e. keeping FSM alive)?
I came up with 2 ways:
1. Have following transition from the waiting state:
Row < state_waiting , none, state_waiting , none, none>
and keep on calling process_event(none())
This however causes the entering the state again and again and gives me
segmentation fault ultimately.
2. Have following transition:
Row < state_waiting, none, state_waiting, none, Gc_always_false>
where guard condition Gc_always_false returns false, prohibiting the
transition but still keeping the state machine alive.
Can you please tell me if the 2nd option is correct and if there is a better
way to sit idle in one state and keep the machine alive.
Thanks!
-- View this message in context: http://boost.2283326.n4.nabble.com/Boost-MSM-Ways-to-send-info-out-from-state-machine-to-outside-world-tp3799703p3800512.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