Boost logo

Boost :

From: Andreas Huber (ah2003_at_[hidden])
Date: 2004-05-27 17:29:01

Darryl Green wrote:

> On a vaguely related note - I have a question about in-state
> transitions. There is an example of a custom reaction to do this.
> However, there is no provision for an action associated with this
> transition. Obviously it is possible to write the action (or call it)
> as part of the custom reaction, but this seems irregular for a
> library that is trying to map directly from/to UML. My eyes glazed
> over a bit trying to follow the transition handling code to add some
> sort of an in_state_transition<> but the concept seems trivial
> enough. Having this facility means that the same action can be used
> for an in-state transition as for other transitions, which seems only
> reasonable, and the similar declaration should make
> developing/modifying a state's transitions easier.

I briefly considered this, but rejected it because in-state reactions can
relatively nicely be implemented with custom_reactions. However, it does
have advantages readability-wise. I'll work out the details and get back to

> For that matter, I
> suppose the transition could actually specialise for the particular
> case of a transition back to the source state, and no special
> declaration would be needed?

No, that would be wrong. UML requires that in a self-transition the exit and
the entry action is called (see StopWatch for an example where such a
transition makes sense). This is not the case for an in-state reaction.



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