Boost logo

Boost :

From: Andreas Huber (ah2003_at_[hidden])
Date: 2004-05-26 02:04:02

David Abrahams wrote:
> Sure, if every state whose entry action can fail has a superstate, you
> can bail out and leave the machine in the superstate. Are you
> requiring that?

No, this is not a requirement. But, you are right in your observation that
the failure of an entry action of an outermost state cannot be handled
anywhere. Consequently, the error handling algorithm will not find a
suitable reaction in such a situation and bail out by rethrowing the
original exception (the state machine is terminated already).

> Is that superstate always a reasonable place to end up upon failure?

Well, you don't excatly end up there, right? The superstate (more accurately
the outermost unstable state) is only a "container" for reaction(s) to the
exception_thrown event. If such a reaction is found and executed it *must*
make a transition to another state (sort of a safe haven) or terminate the
state machine itself. Only then are we stable again.
To answer your question: Yes, I believe so.

> FWIW, I don't know what an orthogonal region is, and I don't have time
> to learn right now, so I'm probably missing a lot.

I don't think you are missing that much. I hope I have managed to convince
you that everything works fine for state machines without orthogonal
regions. Orthogonal regions do complicate the matter but not by a lot.

> If you're still
> convinced you have everything right,

Yes, now I believe even more so than before our discussion.



Boost list run by bdawes at, gregod at, cpdaniel at, john at