
3 May
2011
3 May
'11
2:01 a.m.
SateMachine machine; machine.setData(100); machine.initiate(); machine.setData(200); machine.process_evet(event());
3. access that value from state event handler
sc::result Initial::react(const event()) { cout << "Data:" << context< StateMachine>().getData() << endl; }
Please advise if there is any other better solution
If all you need is to pass the data to the reaction, you can encapsulate it in the event: struct your_event : sc::event<your_event> { data_type data_; }; //.... your_event e; e.data_ = data; machine.process_event(e); //... sc::result react(const your_event &e) { cout << e.data_; }