nomlib
Loading...
Searching...
No Matches
nom::StateDescriptor Struct Reference

Description used to register a state with StateMachine. More...

#include <StateMachine.hpp>

Public Attributes

StateSymbol symbol
 Stack symbol for the state.
StateSymbol parent = NO_STATE
 Stack symbol of the state's declared parent, or NO_STATE for a root.
std::function< IState::unique_ptr(void *data)> factory

Detailed Description

Description used to register a state with StateMachine.

Remarks
The factory must return a valid state instance. The lifetime of the registered descriptors must not exceed that of the StateMachine.

Definition at line 104 of file StateMachine.hpp.

Member Data Documentation

◆ factory

std::function<IState::unique_ptr( void* data )> nom::StateDescriptor::factory

Factory function that constructs the state instance.

Parameters
dataUser-defined data passed from the push/replace request. Use this for per-instance construction arguments that are not known when the state is registered.

Definition at line 117 of file StateMachine.hpp.

◆ parent

StateSymbol nom::StateDescriptor::parent = NO_STATE

Stack symbol of the state's declared parent, or NO_STATE for a root.

Definition at line 110 of file StateMachine.hpp.

◆ symbol

StateSymbol nom::StateDescriptor::symbol

Stack symbol for the state.

Definition at line 107 of file StateMachine.hpp.


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