Boost logo

Boost Users :

Subject: Re: [Boost-users] [statechart] Substates in dll
From: Commander Pirx (CmdPirx_at_[hidden])
Date: 2009-07-10 15:43:49


  "Bill Clark" <bill_at_[hidden]> schrieb im Newsbeitrag news:179b0d0d0907090954v5713336j2a6577f4c354fcde_at_mail.gmail.com...
  Is there any way to partition a state machine using boost::statechart such that the main state machine is in one dll, and its substates (and possibly their substates) are in separate dll's?

  It would seem that this would create a cyclic dependency. Suppose you have e.g. a simple statechart called MyStatechart containing an initial state State1 which transitions to State2 in response to some event. Is it possible to implement MyStatechart and State1 in MyStatechart.dll, and State2 in State2.dll?

  Since the code for State1 will need to reference State2 (in order to transition to it), MyStatechart.dll will have a dependency on State2.dll. But since State2 is contained in MyStatechart, its type will have to look something like

  struct State2: sc::state<State2, MyStatechart>
  {
     //...
  };

  which means that State2.dll will have a dependency on MyStatechart.dll.

  Is it possible to avoid this cycle?

  Thanks for any help,
  Bill

There is a topic in the statechart tutorial http://www.boost.org/doc/libs/1_39_0/libs/statechart/doc/tutorial.html#SpreadingAStateMachineOverMultipleTranslationUnits
 Which covers a similiar topic. Perhaps you can modify your architecture and work with nested state machines.

Pirx



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net