Maki
|
A state set expresses a constraint that defines whether it contains any given state.
std::set
sense.A state set can be "any state", "no state at all", or everything in between.
Maki exposes the maki::state_set
class template to represent state sets. Internally, it's nothing more than a predicate, i.e. a function taking a maki::state
and returning a bool
.
To instantiate a maki::state_set
, you have to compose maki::state_builder
objects with boolean operators, such as:
You can use state sets as source states in transition tables to factorize transitions. In the example below, all the states, except powering_off
itself, transition to powering_off
whenever the state machine processes a power_button_press
event: