boost-statechart

In Boost.Statechart, what's the difference between state and simple_state?

随声附和 提交于 2019-12-07 23:23:57
问题 In implementing a state machine using Boost.Statechart, I came across a problem arising from attempting to access the outer context of a simple_state from its constructor. A comment in simple_state.hpp tells me: // This assert fails when an attempt is made to access an outer // context from a constructor of a state that is *not* a subtype of // state<>. To correct this, derive from state<> instead of // simple_state<>. Apart from apparently being able to access the outer context from its

Why does my use of context<State>().method() violate statechart assertion?

跟風遠走 提交于 2019-12-06 06:04:48
问题 I've developed some concept code for a project that I will be working on shortly. The project lends itself to a state machine design and I think boost::statechart will do a good job. I hit a roadblock when I tried to use context() however. Here's a sample (I'm happy to put more code up, but I think this is the relevant part): struct Wait : fsm::simple_state< Wait, Active > { typedef mpl::list<fsm::transition< UnderflowEvent, Exec> > reactions; public: Wait() : m_wait_op() { std::cout <<

Boost Statechart vs. Meta State Machine

陌路散爱 提交于 2019-12-03 01:34:07
问题 Apparently boost contains two separate libraries for state machines: Statechart and Meta State Machine (MSM). The taglines give very similar descriptions: Boost.Statechart - Arbitrarily complex finite state machines can be implemented in easily readable and maintainable C++ code. Meta State Machine - A very high-performance library for expressive UML2 finite state machines. Do you know what are the key differences and what are considerations in choosing between the two? 回答1: As there seems to