Questions tagged [boost-statechart]

Boost.Statechart is a C++ library allowing you to easily and quickly define state machines.

Boost.Statechart is a C++ library allowing you to easily and quickly define state machines. It is not as high performance as the alternative Boost.MSM but it is more scalable and compiles considerably faster.

44 questions
156
votes
5 answers

Boost Statechart vs. Meta State Machine

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…
FireAphis
  • 6,650
  • 8
  • 42
  • 63
7
votes
2 answers

Boost Statechart - Local transitions

I'm hoping that someone can help me out with this problem, or at least point out the error of my ways... As a simple illustration of my problem consider a part of an application where you can enter a "Functions Mode" state of operation. Four…
Grant
  • 133
  • 7
6
votes
1 answer

Using Boost statechart, how can I transition to a state unconditionally?

I have a state A that I would like to transition to its next state B unconditionally, once the constructor of A has completed. Is this possible? I tried posting an event from the constructor, which does not work, even though it compiles.…
nickb
  • 59,313
  • 13
  • 108
  • 143
5
votes
1 answer

Does Boost.Python need binding code for other boost libraries?

I have a class that inherits from boost::statechart library. I need to use this class in Python script, I am wondering if I need to write wrapper codes (.def s) for all boost::statechart library just because my class inherited from it? Or the…
4
votes
2 answers

boost statechart pass arguments with transition

I'm trying to learn boost::statechart. I want to make a little app which loads a file. // -------------------------------- // | | // | O Project | // | | | // | …
P3trus
  • 6,747
  • 8
  • 40
  • 54
4
votes
1 answer

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

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…
drfrogsplat
  • 2,577
  • 3
  • 19
  • 28
4
votes
1 answer

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

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…
gred
  • 612
  • 1
  • 8
  • 15
3
votes
1 answer

How to give objects to states in a boost::statechart?

I am in the situation where I need to modify a state machine that I did not write. This state machine is written using Boost Statechart. Unfortunately, I find this code impenetrable, and the guy who did write it is on vacation. The problem is…
Andres Jaan Tack
  • 22,566
  • 11
  • 59
  • 78
3
votes
1 answer

boost statechart parallel execution of orthogonal states

I've a state machine that has a couple of orthogonal states. These states react to the same event. When the event is sent via process_event, a simple benchmark tells me that it is processed sequentially, even though the states are orthogonal to each…
Sidd
  • 1,168
  • 2
  • 10
  • 27
3
votes
1 answer

How to know when an asynchronous state machine has terminated. (boost::statechart)

I need to create a boost::statechart::asynchronous_state_machine and I need to be able to "destroy" it externally. I have found in the docs that I should call destroy_processor and terminate to do it. The problem is that these methods just insert…
thamurath
  • 765
  • 8
  • 24
3
votes
1 answer

The Boost Statechart Library - how to implement time-consuming transitions

In our project we have UI and logic (which may be represented as a state machine). Transitions between some steps in this step machine are long (IO-bound). We don't want to steal our UI thread for all the time the transition is in progress.…
Lev
  • 727
  • 5
  • 17
2
votes
1 answer

Multiple deferred events in Boost Statechart

How do multiple deferred events behave in Boost Statechart? Let's say I have 4 states and 3 events. The non-deferred transitions looks as follows: S1--(E1)-->S2--(E2)-->S3--(E3)-->S4 The state machine starts in S1. Now events are posted in the…
Jens Müller
  • 302
  • 4
  • 13
2
votes
1 answer

transition Vs custom_reaction in boost.statechart library

I've read the tutorial of boost.statechart library and its examples, and I've a question related to the transition and its action. There are two ways to define the transition using transition<> and custom_reaction but what is the main difference…
Mahmoud Emam
  • 1,499
  • 4
  • 20
  • 37
2
votes
0 answers

boost statechart, unit-testing fraction of a state-machine

I'm looking for a way to execute (for unit-testing purposes) only fractions of a complex state -machine. For that purpose I'm evaluating boost::statechart framework. One way that I considered was to design a hierarchical state machine, where each…
1
vote
1 answer

Inherit reactions

I'd like to define a base class, derived from statechart::simple_state, which has "predefined" reactions which themselves call virtual functions (which have to be implemented in the deriving classes). What I'd like to have is that some states…
wal-o-mat
  • 7,158
  • 7
  • 32
  • 41
1
2 3