Maki
Loading...
Searching...
No Matches
Transitions

A transition is the fact, for a state machine, to go from a source state to a target state, as a reaction to an event.

There are several kinds of transitions. The kind of a transition is defined by a combination of three traits:

  • the hierarchical position of the target state (relatively to the source state), which is either:
    • sibling: the target and the source belong to the same region (you're already familiar with this case);
    • self: the target is the source (see Self-Transition);
    • substate: the target is a direct substate of the source;
    • superstate: the target is the direct superstate of the source;
  • the nature of the trigger, which is either:
    • an event processed by the state machine (you're already familiar with this case);
    • a state completion (see Completion Transition);
  • the locality, which is either:
    • external, when the source state is exited (you're already familiar with this case);
    • local, when the source state is not exited (see Local Transition).

Before going further, make sure you read the pages linked above.

The table below summarizes all the combinations of the three traits:

Position of TargetLocalityTriggerUML NotationMaki Notation
SiblingExternalEvent
(S, T, maki::event<E>)
SiblingExternalState completion
(S, T, maki::null)
SiblingLocalEventIrrelevant; transitions to siblings are inevitably external.
SiblingLocalState completionIrrelevant; transitions to siblings are inevitably external.
SelfExternalEvent
(ST, ST, maki::event<E>)
SelfExternalState completion
(ST, ST, maki::null)
SelfLocalEvent
(ST, maki::null, maki::event<E>, A)

or

constexpr auto ST = maki::state_mold{}
{
//...
})
;
SelfLocalState completionIrrelevant.
SubstateExternalEvent Not implemented.
SubstateExternalState completion Not implemented.
SubstateLocalEvent
(maki::all_states, T, maki::event<E>)
SubstateLocalState completion Not implemented.
SuperstateExternalEvent Not implemented.
SuperstateExternalState completion Not implemented.
SuperstateLocalEventIrrelevant; transitions to superstates are inevitably external.
SuperstateLocalState completionIrrelevant; transitions to superstates are inevitably external.