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

Boost msm problems with events and state reuse

I am having problems with my transition table and events. Let me explain the fake design that illustrates the problem: I have a state machine (myStateMachine) containing 2 states (s0 and s1) and 1 substatemachine (subm1). the substatemachine subm1…
Kam
  • 5,878
  • 10
  • 53
  • 97
1
vote
1 answer

Boost MSM library giving errors

The below code is an example given in boost msm documentation for functor front end. #include #include // back-end #include //front-end #include //…
ken
  • 816
  • 1
  • 9
  • 25
0
votes
0 answers

Using derived event to trigger the transition of boost-msm's state machine

I understood that if the transition for handling the event of Derived was not declared. I will got an error of no transition. It's OK. Here is the example about it. #include #include #include…
Flames
  • 1
  • 1
0
votes
0 answers

FSM. Next state condition in transition - is it acceptable?

I need architectural advice. I'm new to c++ and FSM principles. I have pet project that used rdkafka and QT ui. I want to write FSM layer on top of my rdkafka consumer for managing it state. I don't understand where to have my state-transition…
Sem Grozovski
  • 404
  • 3
  • 11
0
votes
1 answer

boost msm usage of stop()

I noticed that with boost::msm the stop function behaves different than I expected. Lets say I do sm state_machine; state_machine.start(); state_machine.process_event(event_a()); pstate(state_machine); std::cout << "stop sm" <<…
alex
  • 310
  • 1
  • 6
0
votes
0 answers

boost.msm how to call current state method

I have to implement some logic with public interface(API). int api_open(); int api_1(int a, int b); int api_2(int x, int y); ... Returning values and "meaning" of each API call depends on some state. Rule example: if you make any api call before…
sigmaN
  • 187
  • 9
0
votes
1 answer

Boost MSM: using state machine itself as implicit top level state

I have a state machine with states A, B and C. C handles event e directly, while A and B do not, but I want to fallback to a default handler (what Samek calls the "ultimate hook" pattern) for event e (that will be called when no handler is found in…
pmf
  • 7,619
  • 4
  • 47
  • 77
0
votes
0 answers

How to retreive containing state machine with Boost MSM

I use Boost MSM, and I have to pass data / use functions around my state machine. For this I use actions or on_entry hooks to get the data from the event, or get_state() to get data from a previous use state. Howerver I cannot access the underlying…
Hugal31
  • 1,610
  • 1
  • 14
  • 27
0
votes
1 answer

Deferring events from sub state machine

In my project, there is a state machine implemented using boost meta state machine. This main state machine, there is a state (let's call it SubMachineEntry for simplicity) that represents an entry point to a sub state machine: namespace msmf =…
Marko Popovic
  • 3,999
  • 3
  • 22
  • 37
0
votes
1 answer

How to Use boost msm combined with boost signal?

I am really new to "boost msm", now I occured into a question, how to use boost signal within boost msm, I have tried many times but doesn't work. What I want to achieve is when the machine changes its state, the action operator sends a signal out,…
耿沛文
  • 1
  • 1
0
votes
0 answers

QStateMachine automatic transitions or mix boost::msm with QObject

I am pretty new to C++ and Qt and I want to develop a machine control and model the process via state machines. Up until now I separated my code into different QObjects running in different QThreads which communicate via QTs signal/slot concept. Up…
kain
  • 129
  • 1
  • 7
0
votes
1 answer

How to reuse code (a Guard) defined in a submachine in the parent SM (using boost-msm)?

I've defined a guard in a sub-state machine and now I want to use the exact logic/guard in the parent SM (using boost-msm). using the same guard in the transition_table results in compilation error: unknown type name 'GuardSS'. I've defined the…
qwa
  • 123
  • 10
0
votes
1 answer

How can I determine if a specific state is Active or not in boost-msm?

The processing done inside a state depends on whether another state is active or not. How can I determine if a specific state is Active or not in boost-msm? I had sth like the following pseudo code in mind: auto state =…
0
votes
1 answer

How to exit a submachine in a hierarchial-SM that is split into multiple files? (using boost::MSM)

There is a good tutorial that explains how we can use the "exit-pseudo-state" to exit from a submachine using boost::MSM, here. But I need to split my SM into multiple files, to keep it manageable, and here is where the problem arises. When the…
qwa
  • 123
  • 10
0
votes
1 answer

How to implement a "BaseState" with access to back/front end of the state-machine (SM) in boost::msm

I want to share data and access between states as well as the SM as a whole and the client code (i.e. the code outside the SM). Based on what I've come up with on the net, the best way would be to inherit all states from a base class. Adding a base…
qwa
  • 123
  • 10