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
HierarchicalStateMachine
ged edited this page Sep 9, 2024
·
5 revisions
Represents a hierarchical state machine class that manages state transitions, in a form of hierarchy.
This composite state structure allows it to form a hierarchy, enabling complex state behaviors such as entering/exiting nested states, or updating nested states.
template<class TContext>
class HierarchicalStateMachine;-
TContext: The type of the context, which holds data or behavior relevant to the state machine.
-
HierarchicalStateMachine<TContext>::State- Represents a state in the hierarchical state machine.
-
HierarchicalStateMachine<TContext>(TContext*, bool = false)- Initializes a
HierarchicalStateMachine<TContext>instance that has a specified context and a boolean flag to enable deep transitions.
- Initializes a
-
isInState(HierarchicalStateMachine<TContext>::State&)- Checks if the state machine is currently in the specified state.
-
transitionTo(HierarchicalStateMachine<TContext>::State&, bool = false)- Transitions the state machine to a specified state.
-
update()- Processes the state machine's update cycle.
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()