Boost logo

Boost Users :

Subject: Re: [Boost-users] [MSM] state transitions and exceptions
From: Juraj Ivanèiæ (juraj.ivancic_at_[hidden])
Date: 2012-03-29 13:07:53

On 29.3.2012. 10:55, Stephan Menzel wrote:
> Everyone,
> I did just get around to give the MSM a first shot and I have say I am
> impressed at the neat design, the ease of use, "understandability",
> tutorial ... exceptional work. Really great and it helped me a great
> deal so far. So thanks a bunch for this teriffic addition to boost.
> That's the kind of stuff I love boost for.

I know how you feel. MSM is an awesome library. Unfortunately compilers
tend to disagree :)

> There is one question however that puzzles me. How can / do I prevent
> state transistions when a transition function throws?

MSM has two kinds of transition functions, actions and guards. What you
are describing above is an action, and it is not designed to prevent the
transition. You should use a guard. Guards have a boolean return value.
For an example see good_disk_format() function in the SimpleTutorial.cpp
in the MSM docs.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at