Questions tagged [boost-msm]

Boost.MetaStateMachine is a C++ library allowing you to easily and quickly define state machines of very high performance.

Boost.MetaStateMachine is a C++ library allowing you to easily and quickly define state machines of very high performance.

70 questions
2
votes
1 answer

Boost MSM call .process_event on outerSM's orthogonal region from submachine

I implemented the depicted state machine as a minimum example in boost::msm. The Code may be reviewed here: https://wandbox.org/permlink/tIhZao8YGhJvPMfF As shown in the code below I want to call event2 from "someAction", which works fine when…
Lgrei
  • 21
  • 3
2
votes
1 answer

Handle an error from every state in Boost MSM

I am using Boost MSM to model the behavior of a robot. There are multiple states, as "ManualMove", "AutoMove", "Work", "Idle", etc... However I need to be able to force stop the robot from any state, putting it in state where it cannot move and…
Hugal31
  • 1,610
  • 1
  • 14
  • 27
2
votes
1 answer

Sub state-machine as inital active state in boost::msm

I want a sub state-machine to be the "initial_state" of a state-machine. The following should be a broken down version of the code. struct E { }; struct A : public boost::msm::front::state<> { template
abergmeier
  • 13,224
  • 13
  • 64
  • 120
2
votes
1 answer

Boost MSM, transition won't happen despite boost::any being used as an event

I'm developing a state machine using boost MSM framework. Their tutorial states that boost::any can be used as a "Kleene event", allowing transition on any event being fired, if the current state is the source state. This doesn't work for me,…
Kikosha
  • 343
  • 6
  • 16
2
votes
1 answer

Thread safety in Boost msm

I am new to boost meta state library. I am building one app, where I have to use msm. My application has two threads, where they use same msm object as a shared resources. Now will the msm be thread safe if both threads call process_event on the…
2
votes
2 answers

boost msm - boost msm multiple deferred events

Let's say I have 2 states, an Active state and an Idle state. If I receive some events in Active state I would like to defer them and execute them when I go back to Idle state. But when I go back to Idle State is there a way to chose which…
Kam
  • 5,878
  • 10
  • 53
  • 97
2
votes
1 answer

Access front end by the back end of boost meta state machine

For some reasons, I can't setup the parameter of the state machine by constructor So I would like to access the public member function of the meta state machine by the back end. That is, I want something like typedef…
StereoMatching
  • 4,971
  • 6
  • 38
  • 70
2
votes
1 answer

boost msm, how can I determine if a transition occurred?

When I fire process_event("eventname"), How can I check if the state transition occurred or if no_transition was called? Basically, I would like that the class that fires/calls process_event("eventname") be able to tell if the transition occurred.…
Kam
  • 5,878
  • 10
  • 53
  • 97
1
vote
0 answers

Boost state machine deferred event

struct transition_table : mpl::vector< Row < waiting, update, pending, send_replace, none>, Row < pending, update, none, Defer, none>, Row < pending, replaced, waiting, ack_replace, none> > { }; If second transition is Defer twice in a…
Guillaume Paris
  • 10,303
  • 14
  • 70
  • 145
1
vote
0 answers

State machine radio buttons

How can I implement radio buttons in boost meta state machine? The problem is the amount of transitions grows quadratically, e.g. with 3 buttons the options are: 1 -> 2 1 -> 3 2 -> 1 2 -> 3 3 -> 1 3 -> 2 But with 4 buttons the options are: 1 -> 2 1…
Daniel
  • 30,896
  • 18
  • 85
  • 139
1
vote
1 answer

How to use Boost.MSM is_flag_active inside on_entry?

I would like to use is_flag_active() function inside one of my state's on_entry template function: struct StBladeDown : public msm::front::state<> { template void on_entry(Event const& event, FSM& fsm) { …
Gabor Marton
  • 2,039
  • 2
  • 22
  • 33
1
vote
1 answer

boost msm cannot processing polymorphic event?

I am using boost:msm to create a state machine. It seems when processing events, the state machine does not care about polymorphism. Say I have multiple events all derived from a base event: struct EvtBase { virtual ~EvtBase();} struct EvtA :…
auzn
  • 613
  • 3
  • 14
1
vote
1 answer

boost::mp11::mp_list can't define proper transition table for FSM based on boost::msm, what is missing?

Does boost::mp11::mp_list can be used instead of boost::mpl::vector as transition-list in state-machines constructed with boost::msm? I just tried it (link) and it seems that: it compiles but it does not work - transitions tables are missing and…
PiotrNycz
  • 23,099
  • 7
  • 66
  • 112
1
vote
1 answer

Boost MSM with constructor parameters on a submachine

I'm trying to share the SyncBox object between a main state-machine and a sub state-machine. The ideal way is to pass it on the constructor (sub state machine will be a initial state of one of the regions in a more complex case). No matter what, I…
AndrewBloom
  • 2,171
  • 20
  • 30
1
vote
1 answer

Boost MSM + ASIO with coroutines. A Simple test case not working

I'm trying to build a small example combining two boost examples from the docs. The first one is an example from the MSM (state machines) library: https://www.boost.org/doc/libs/1_75_0/libs/msm/doc/HTML/examples/AnonymousTutorialWithFunctors.cpp the…
AndrewBloom
  • 2,171
  • 20
  • 30