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
1
vote
1 answer

How to get the current most derived state in a boost::statechart state_machine object?

I am using boost::state_chart library. For debug purposes, I would like to know at any given time the state of my state machine. How to get the current (most derived) state in the state_machine object ?
wip
  • 2,313
  • 5
  • 31
  • 47
1
vote
0 answers

reacting to all orthogonal states having finished in Boost.statechart

I'm working on a robot control program that is based on a state machine. While the program uses Qt State Machine Framework, I also attempted to implement it using Boost.statechart (BS) as a theoretical exercise and a way to learn / evaluate the…
artm
  • 3,559
  • 1
  • 26
  • 36
1
vote
2 answers

Recording state changes in boost::statechart

For Unit Testing, I'm trying to record all the state transactions after I kick off a state machine event. E.g., if I post_event A to the fifo_scheduler of an async_state_machine, the state machine will go through states B, C, then back to D. Without…
kenyee
  • 2,309
  • 1
  • 24
  • 32
1
vote
0 answers

boost statechart: Is it still maintained?

I currently use boost::state_chart in one of my projects. As the changelog [1] Shows the last activity in boost 1.46.0, is it still maintained or should i switch to…
schorsch_76
  • 794
  • 5
  • 19
1
vote
1 answer

Boost Statechart: Return to Previous State

I've got a state machine wherein if I enter a particular state, sometimes I need to have a regular transition to another state and other times I need to return to a previous state. For example, having states A B C, say that transition S moves state…
singhh23
  • 97
  • 7
1
vote
1 answer

Unit testing with boost::statechart

We are using the boost statechart library and have troubles writing unit tests for the code. In our normal execution the state machine starts in ClosedState: struct BoostStateMachine : sc::state_machine We would…
FireAphis
  • 6,650
  • 8
  • 42
  • 63
1
vote
1 answer

Boost statechart - pass event data to state constructor using triggering_event

I would like to be able to communicate the data from an event to a state that gets constructed as a result of a transition. From this post in 2009 and this one in 2010 the use of triggering_event() is suggested. However, I can't find an example…
ksl
  • 4,519
  • 11
  • 65
  • 106
1
vote
1 answer

UML state charts: completion transitions

In the context of UML state charts with the run-to-completion model, how are "completion transitions" processed? The completion of a state inserts a "completion event" at the beginning of the event queue and the "completion transition" is thus only…
ARF
  • 7,420
  • 8
  • 45
  • 72
1
vote
1 answer

Notification about state change in Boost Statechart

Is there a straightforward method of registering to state change in Boost Statechart? For the Digital Camera example, let's say I decide to add a GUI to the application. Is there a possibility to be notified about transition between states, other…
Alexandru Irimiea
  • 2,513
  • 4
  • 26
  • 46
1
vote
1 answer

Boost.Statechart - issue with documented method for choice points

As per the example in the documentation I made the following code that fails to compile because custom_reaction<> does not seem to match the concept expected as the third template parameter to state<>. How do I really make choice points? (I also…
Edward Strange
  • 40,307
  • 7
  • 73
  • 125
1
vote
1 answer

How to prevent boost::statetechart from terminating due to exception thrown

I have implemented a state machine that inherits boost::statechart. When I call fsm.process_event( some_event() ) which reaction is expected to throw exception it turns out that after I handle the exception with try-catch block my statemachine…
0xC0DEGURU
  • 1,432
  • 1
  • 18
  • 39
1
vote
1 answer

Can't compile my state machine code

I'm trying to make a state machine DcuClientMachine, having two states - StandBy (the default one) and Operating. StandBy is just a simple state, while Operating is a nested one, having Parsing state as it's default. EvConnecting event supposes to…
fogbit
  • 1,961
  • 6
  • 27
  • 41
1
vote
1 answer

boost::statechart: How to define two sub states of certain state, without specifying which one is default?

The following code fails to compile: namespace sc = boost::statechart; class Active; class FSM : public sc::state_machine< FSM, startup> { }; class ev_1 : public sc::event {}; class ev_2 : public sc::event {}; class Active : public…
0xC0DEGURU
  • 1,432
  • 1
  • 18
  • 39
1
vote
1 answer

how to use boost in_state_reaction

I'm trying to use in_state_reaction. Oddly the react function for this doesn't seem to be executed after process_event () is called. I changed in_state_reaction to custom_reaction and it seems fine. Just want to know how do I make it work with…
1
vote
0 answers

boost::statechart and non-const events

Is there a way to define boost::statechart::in_state_reactions allowing non-const events to be passed to reaction functions?
Martin
  • 9,089
  • 11
  • 52
  • 87