Boost logo

Boost Users :

Subject: Re: [Boost-users] [msm] Manually setting next state
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2013-05-22 16:09:38


  ----- Original Message -----
  From: samriti katoch
  Newsgroups: gmane.comp.lib.boost.user
  To: boost-users_at_[hidden]
  Sent: Wednesday, May 22, 2013 4:12 PM
  Subject: [msm] Manually setting next state

  Hi,

  Is there a way to manually set the next state for the state machine.

  I have an orthogonal region defined for handling errors, where Error is an interruptible state.

  ---------- -------------

  | | ----------->| Error |

  | Ok | | |

  ---------- -------------

  This is similar to the example here : http://svn.boost.org/svn/boost/trunk/libs/msm/doc/HTML/examples/Orthogonal-deferred.cpp

  Once the state machine recovers from the error, I would like to start from the initial state again in the main orthogonal region.

  Is there a way to do this ?

  Thanks!
  Samriti

------------------------------------------------------------------------------

  _______________________________________________
  Boost-users mailing list
  Boost-users_at_[hidden]
  http://lists.boost.org/mailman/listinfo.cgi/boost-users

Hi,
technically, yes, you could call current_state() on the fsm, which gives you an array of ids for all regions, which you could change, but it's not good style, the UML conform way would be to send yourself an event in the transition Error -> Ok, which would move the first region to the initial (or any other) state. Of course, this costs more transitions.

HTH,
Christophe



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