boost-msm

Boost.MSM: Exit orthogonal regions via a join pseudo state

穿精又带淫゛_ 提交于 2020-01-02 04:04:08
问题 I intend to use boost.msm with the concept of composite containing orthogonal regions . I want to synchronize all orthogonal regions upon exit. In other words: the state following my composite shall be activated if and only if all regions have reached their last state. UML 2.4 "Superstructure" proposes join pseudo states (i.e. chapter 15.3.8). In boost, there is a fork but I cannot find any implementation of its counterpart join. Is there no join pseudo state in boost.msm? How would I apply

How to Pass data to the current boost meta state machine(MSM) substate

微笑、不失礼 提交于 2019-12-13 07:56:38
问题 In the following example, while the current execution is still in substate1, I want to pass data to substate1 continuously and then send Event3 or Event1 based on the data. Looks like MSM supports only sending events using (process_event()), but I am not sure how to send data continuously to the current state. #include <iostream> #include <boost/msm/back/state_machine.hpp> #include <boost/msm/front/state_machine_def.hpp> #include <boost/msm/front/functor_row.hpp> namespace { namespace msm =

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

…衆ロ難τιáo~ 提交于 2019-12-13 03:57:14
问题 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 class and making all states & the SM to inherit from that is simple, but how can I add the handler to the backend/frontend of the SM as a member of this base class and how can I initialize it? This sample code compiles, but crashes when accessing

Boost msm problems with events and state reuse

≯℡__Kan透↙ 提交于 2019-12-12 05:37:30
问题 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 contains an initial state 'sub0' and also s1 (the same state as in myStateMachine). this is the main transition table: s0->s1 on event 'ES1' s0->s2 on event 'ES2' s0->subm1 on event 'ESUB' this is the submachine transition table: sub0->s1 on event

Thread safety in Boost msm

两盒软妹~` 提交于 2019-12-11 03:02:31
问题 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 same msm object? Any idea is welcome. 回答1: Quoting Christophe Henry, who answered this when you asked it on the Boost.Users list: msm is as thread-safe as a STL container: it's not. Different threads should not call process_event on the same state

Boost.MSM: Exit orthogonal regions via a join pseudo state

回眸只為那壹抹淺笑 提交于 2019-12-05 10:51:41
I intend to use boost.msm with the concept of composite containing orthogonal regions . I want to synchronize all orthogonal regions upon exit. In other words: the state following my composite shall be activated if and only if all regions have reached their last state. UML 2.4 "Superstructure" proposes join pseudo states (i.e. chapter 15.3.8). In boost, there is a fork but I cannot find any implementation of its counterpart join. Is there no join pseudo state in boost.msm? How would I apply the concept of join pseudo state with boost.msm? You could use a counter which will increment each time

Boost MSM parallel behavior with delayed self-transitions?

核能气质少年 提交于 2019-12-04 02:04:21
问题 I am using Boost MSM (basic and functor front-ends) and am trying to implement the following state machine: In words: Enter state State1 Enter state A and execute action_A. After 2 seconds, print "Trying again..." and re-execute state A (i.e. call its entry action). This loops forever... At the same time as 2 (i.e. "in parallel"), enter state B and execute action_B. After 5 seconds, print "Trying again..." and re-execute state B (i.e. call its entry action). This loops forever... I would like

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

Boost MSM parallel behavior with delayed self-transitions?

ε祈祈猫儿з 提交于 2019-12-01 12:50:27
I am using Boost MSM (basic and functor front-ends) and am trying to implement the following state machine: In words: Enter state State1 Enter state A and execute action_A. After 2 seconds, print "Trying again..." and re-execute state A (i.e. call its entry action). This loops forever... At the same time as 2 (i.e. "in parallel"), enter state B and execute action_B. After 5 seconds, print "Trying again..." and re-execute state B (i.e. call its entry action). This loops forever... I would like to know the way to create this state machine in Boost MSM. There are two tricks here which I cannot