qwa
qwa

Reputation: 143

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 = fsm.get_state<MyFsm_::State_x&>(); bool state_Status = state.isActive();

Upvotes: 0

Views: 1177

Answers (1)

Wei Guo
Wei Guo

Reputation: 564

You can have a look at the link (about Flags & Getting a state): https://www.boost.org/doc/libs/1_64_0/libs/msm/doc/HTML/ch03s05.html#d0e2489

However, boost-msm is fast but very complicated as well. It will make your code hard to understand if not used properly.

I recommend you to use the State Pattern.

Upvotes: 0

Related Questions