I'm playing with the statechart library, in conjunction with Boost 1.33 and VC 7.1. I'm having trouble using the state history functionality; I can't get it to compile, even taking into account the useful static assertions that ought to be helping me. Can someone suggest what I might be missing?Here's a boiled down sample:
Hi John
are 2 top-level states, StateA and StateB. Event2 transitions between them. When in StateA, Event1 transitions between 2 sub-states, StateA1 and StateA2. When transitioning from StateB to StateA, I want to use StateA's history to determine which of StateA1 and Stae2 become active.
I'm very sorry for the late answer, but I missed your post back in September because it was sent in reply to an unrelated post (Boost Graph Library). Mick's analysis of the problem is correct. When you make a transition to history then you must specify the *default* *state* that is entered in case the history has never been saved before. The *outer* *state* of the default state must then pass the appropriate has_xxx_history. Note that this is very much in line with the UML notation. A transition to history always goes to a H disc first and from that H disc you have another arrow to the default state. The state containing the H disc is said to be the one "having history".
From reading the tutorial, references, and sample code, it looks like this should work: [example snipped]
I checked the docs and I can't find any examples that display the wrong syntax you used. A pointer would be appreciated. HTH & Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.