[statechart] split different orthogonal regions over different translation units
Hey, Im trying to split the orthogonal regions over differnent translation units, but it doesn't compile. The compiler complains that the type is incomplete, which i try to put on a different translation unit. What i do is: Forward declare the orthogonal region and define than the outermost state "Active" like this: struct StateInDifferentTransUnit; struct Active; struct Start : sc::asynchronous_state_machine< Start, Active >{ ... } struct Active : sc::state< Active, Start, mpl::list< State1, State2, StateInDifferentTransUnit > >{ ... } Is the split in different translationunits not possible with orthogonal regions or what could be my problem? Kind Regards Manuel
Hi [snip]
Is the split in different translationunits not possible with orthogonal regions or what could be my problem?
It is possible, but you can only do that by introducing an additional "indirection" via a custom_reaction. Please see ... <http://www.boost.org/doc/libs/1_36_0/libs/statechart/doc/tutorial.html#Sprea... gAStateMachineOverMultipleTranslationUnits> ... and also the source code of the camera example. Please let me know if that leaves any questions. Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
participants (2)
-
Andreas Huber
-
Manuel Jung