Skip to content

Instance Methods

Andrew Gresyk edited this page Apr 12, 2024 · 1 revision
Method Description
static StateID Root::stateId<TState>(); Query StateID for a state type
Context& Root::context();
const Context& Root::context() const;
Access context
void Root::setContext(const Context&);
void Root::setContext(Context&& context);
Set context
void Root::enter();
void Root::exit();
Optional manual activation
and deactivation
void Root::update(); Trigger recursive update cycle on active states,
and execute any queueued transitions
void Root::react<TEvent>(const TEvent&); Trigger recursive event reaction cycle on active states,
and execute any queueued transitions
void Root::changeTo<TState>()
void Root::changeTo(const StateID);
Enqueue transition (will be executed during
the next update() or react())
void Root::changeWith<TState>(const TPayload&);
void Root::changeWith(StateID, const TPayload&);
Enqueue transition with const payload
void Root::changeWith<TState>(TPayload&&);
void Root::changeWith(StateID, TPayload&&);
Enqueue transition with moved payload
bool Root::isActive<TState>() const;
bool Root::isActive(const StateID) const;
Query if state is active
TState& Root::access<TState>();
const TState& Root::access<TState>() const;
Access TState data
void Root::save(SerialBuffer& buffer) const;
void Root::load(const SerialBuffer& buffer);
Serialization
const Transition& Root::previousTransition() const;
void Root::replayEnter(const StateID);
bool Root::replayTransition(const StateID);
Replication
Root::Root(Context&, Logger* const);
void Root::attachLogger(Logger* const);
Logging