![]() |
PIP 5.6.1
Platform-Independent Primitives
|
Final state that finishes its parent state when entered. More...
#include <pistatemachine_state.h>

Public Member Functions | |
| PIStateFinal (std::function< void()> on_finish=nullptr, const PIString &n={}) | |
| Creates a final state with an optional callback executed on entry. | |
| void | onEnter () override |
| Executes the finish callback when the final state is entered. | |
Public Member Functions inherited from PIStateBase | |
| PIStateBase (const PIString &n={}) | |
| Creates a state with an optional diagnostic name. | |
| virtual | ~PIStateBase () |
| Destroys the state together with owned child states and transitions. | |
| virtual void | onEnter () |
| Called when the state becomes active. | |
| virtual void | onExit () |
| Called when the state becomes inactive. | |
| virtual void | onFinish () |
| Called when a final child finishes this state. | |
| PIStateMachine * | machine () const |
| Returns the root state machine. | |
| PIStateBase * | parent () const |
| Returns the parent state. | |
| PIStateBase * | activeChild () const |
| Returns the active child of a non-parallel compound state. | |
| PIVector< PIStateBase * > | activeChildren () const |
| Returns active child states. | |
| PIVector< PIStateBase * > | activeAtomics () const |
| Returns active atomic leaf states below this state. | |
| void | addState (PIStateBase *s) |
| Adds a child state owned by this state. | |
| void | addStates (PIVector< PIStateBase * > s) |
| Adds multiple child states owned by this state. | |
| void | setInitialState (PIStateBase *s) |
| Sets the initial child state for a non-parallel compound state. | |
| PITransitionBase * | addTransition (PIStateBase *target, int event_id) |
| Adds an event-driven transition from this state to target. | |
| PITransitionTimeout * | addTimeoutTransition (PIStateBase *target, PISystemTime timeout) |
| Adds a timeout transition that fires while this state stays active. | |
| void | setParallel (bool yes) |
| Enables or disables parallel activation of child states. | |
| const PIString & | getName () const |
| Returns the state name. | |
| bool | isStateMachine () const |
| Returns true for the root machine object. | |
| bool | isActive () const |
| Returns true if the state is currently active. | |
| bool | isParallel () const |
| Returns true if child states are activated in parallel. | |
| bool | isFinal () const |
| Returns true if the state is marked as final. | |
| bool | isAtomic () const |
| Returns true if the state has no children. | |
| bool | isCompound () const |
| Returns true if the state owns child states. | |
| const PIVector< PIStateBase * > & | getChildren () const |
| Returns direct child states. | |
| const PIVector< PITransitionBase * > & | getTransitions () const |
| Returns outgoing transitions owned by this state. | |
| void | print (PIString prefix={}) |
| Prints the state tree and active branches to piCout. | |
| PIVector< PIStateBase * > | gatherStates () |
| Returns this state and all descendant states. | |
Additional Inherited Members | |
Related Functions inherited from PIStateBase | |
| PICout | operator<< (PICout c, PIStateBase *s) |
| Writes a textual representation of a state to PICout. | |
Final state that finishes its parent state when entered.