Loading...
Searching...
No Matches
ml::MultiCustomStateManager<> Class Reference

No-op specialization used when no custom states are declared. More...

#include <MultiCustomStateManager.h>

Inheritance diagram for ml::MultiCustomStateManager<>:

Public Member Functions

StateEnums getState () const
 Return the current state value.
bool isState (StateEnums state) const
 Return true if the current state equals state.
void onStateEnter (...)
void onStateEnter (std::function< void(StateEnums)> cb)
 Register a callback invoked when any state is entered.
void onStateExit (...)
void onStateExit (std::function< void(StateEnums)> cb)
 Register a callback invoked when any state is exited.
void setState (...)
void setState (StateEnums newState)
 Transition to a new state.

Detailed Description

No-op specialization used when no custom states are declared.

Adds no storage. The variadic ... absorb accidental calls so that using declarations in ComponentCore still compile.

Definition at line 148 of file MultiCustomStateManager.h.

Member Function Documentation

◆ getState()

StateEnums ml::SingleStateManager< StateEnums >::getState ( ) const
inline

Return the current state value.

Returns
The active state.

Definition at line 57 of file MultiCustomStateManager.h.

◆ isState()

bool ml::SingleStateManager< StateEnums >::isState ( StateEnums state) const
inline

Return true if the current state equals state.

Parameters
stateState value to compare against.
Returns
true if currently in state.

Definition at line 64 of file MultiCustomStateManager.h.

◆ onStateEnter() [1/2]

void ml::MultiCustomStateManager<>::onStateEnter ( ...)
inline

Definition at line 152 of file MultiCustomStateManager.h.

◆ onStateEnter() [2/2]

void ml::SingleStateManager< StateEnums >::onStateEnter ( std::function< void(StateEnums)> cb)
inline

Register a callback invoked when any state is entered.

The callback receives the newly entered state as its argument. Only one enter callback is active at a time; calling this again replaces the previous one.

Parameters
cbCallback invoked with the new state after each transition.

Definition at line 75 of file MultiCustomStateManager.h.

◆ onStateExit() [1/2]

void ml::MultiCustomStateManager<>::onStateExit ( ...)
inline

Definition at line 153 of file MultiCustomStateManager.h.

◆ onStateExit() [2/2]

void ml::SingleStateManager< StateEnums >::onStateExit ( std::function< void(StateEnums)> cb)
inline

Register a callback invoked when any state is exited.

The callback receives the state being left as its argument. Only one exit callback is active at a time; calling this again replaces the previous one.

Parameters
cbCallback invoked with the old state before each transition.

Definition at line 86 of file MultiCustomStateManager.h.

◆ setState() [1/2]

void ml::MultiCustomStateManager<>::setState ( ...)
inline

Definition at line 151 of file MultiCustomStateManager.h.

◆ setState() [2/2]

void ml::SingleStateManager< StateEnums >::setState ( StateEnums newState)
inline

Transition to a new state.

If an exit callback is registered, it is called with the current state before the transition. If an enter callback is registered, it is called with the new state after the transition.

Parameters
newStateThe state to transition into.

Definition at line 46 of file MultiCustomStateManager.h.


The documentation for this class was generated from the following file: