|
Boost : |
Subject: Re: [boost] [msm] eUML guard/action location
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2009-12-08 09:58:08
Hi Michael, hi Robert, hi Felipe,
>CurrentState() + cool_event()
>[VeeeeeryLoooooooooongGuard()]
>/(LooooooooooooooooongAction()) = DestState()
I just wanted to bring an example from SimpleTimer (see doc):
Ringing() + tick() == Ringing() [ Source_<m_ringing_cpt>() -
Event_<m_tick>() > Int_<0>() ]
/
(Source_<m_ringing_cpt>() -= Event_<m_tick>() )
would become:
Ringing() + tick() [ Source_<m_ringing_cpt>() - Event_<m_tick>() > Int_<0>() ]
/ (Source_<m_ringing_cpt>() -=
Event_<m_tick>() ) == Ringing()
Here, it is becoming hard to write action and target state on the same
line. And the action can be as big as one wishes.
>Here's another suggestion, though it breaks from the logical UML ordering Michael posted previously:
>DestState() = CurrentState() + cool_event()[guard()]/(action())
I like this one quite much! Not UML at all but pretty much C++-style.
And it'd become easy to write guard and action on the next lines if
needed.
>CurrentState() + cool_event()[guard()]/(action()) -> DestState()
It's very similar with Michael's syntax but I think the operator
precedence can be hard to master and we'll need extra parentheses.
I think there is no operator -> in proto but ->* .
We are making progress :)
Christophe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk