This repository was archived by the owner on Nov 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
FiniteStateMachine ctor()
ged edited this page Sep 9, 2024
·
10 revisions
Initializes a FiniteStateMachine<TContext> instance that has a specified context.
FiniteStateMachine(TContext* context)-
context: The context to be used by the state machine.
The state machine uses a context of type TContext to share information between states.
The context is passed to each state's callback, allowing the states to modify or query shared data.
// primitive context
int foo = 5;
FiniteStateMachine<int> fooSM1(&foo);
// user-defined context
struct FooContext; // implementation omitted for brevity
auto fooContext = FooContext();
auto fooSM2 = FiniteStateMachine<FooContext>(&fooContext);Common Types
→ StateStatus (enum)
→ StateCallback (alias)
Finite State Machine (FSM)
→ State
→ ctor()
→ isInState()
→ transitionTo()
→ update()
Hierarchical State Machine (HSM)
→ State
→ ctor()
→ isInState()
→ transitionTo()
→ update()
State Base
→ ctor()
→ is()
→ enter()
→ update()
→ exit()
State Machine Handler
→ ctor()
→ getNextState()
→ getActiveState()
→ isInState()
→ setNextState()
→ queueTransition()
→ beginTransitionQueue()
→ endTransitionQueue()
→ execute()