Boost logo

Boost :

Subject: Re: [boost] [statechart] Undefined type
From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2010-03-16 18:27:23


> Thankyou for your help. The code example previously sent was providing
> an overview of the code layout (transitions removed). Adding transitions
> shows the problem under vc2003 e.g:

Please see the attached code, tested with VS2008. I introduced a level of
indirection with the B0Dummy & C0Dummy states, declared in the M.hpp header.
The trick is to have these states post an event in their entry action and
then use a custom_reaction to immediately transition to B0 & C0. This works
because now the transition target only needs to be mentioned in the cpp.
Yes, the definition of two additional states & 2 events is a bit cumbersome,
but this is sort of a worst case. E.g. it would have been much easier to
implement A2 & A3 in their own CPPs, because there you'd only have to
replace a transition with a custom_reaction.

HTH,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk