![]() |
PIP 5.6.1
Platform-Independent Primitives
|
Transition between states in PIStateMachine. More...
#include <pistatemachine_transition.h>

Public Member Functions | |
| PITransitionBase (PIStateBase *source, PIStateBase *target, int event_id) | |
| Creates a transition from source to target for the specified event identifier. | |
| virtual | ~PITransitionBase () |
| Destroys the transition and its stored guard. | |
| PIStateMachine * | machine () const |
| Returns the root state machine. | |
| PIStateBase * | source () const |
| Returns the source state. | |
| PIStateBase * | target () const |
| Returns the target state. | |
| template<typename R , typename... Args> | |
| PITransitionBase * | addGuard (std::function< R(Args...)> f) |
| Sets a guard function that must return bool. | |
| template<typename L > | |
| PITransitionBase * | addGuard (L f) |
| Sets a guard from a lambda or other callable object. | |
| template<typename... Args> | |
| bool | testGuard (Args... args) |
| Tests the guard against event arguments passed to the transition. | |
| PITransitionBase * | addAction (std::function< void()> a) |
| Sets an action executed when the transition fires. | |
| void | makeAction () |
| Executes the transition action if it is set. | |
| void | trigger () |
| Triggers the transition and updates active states. | |
Transition between states in PIStateMachine.
A transition can be triggered by an event or by a timeout. Optional guards are evaluated against arguments passed to PIStateMachine::postEvent().