-
-
Notifications
You must be signed in to change notification settings - Fork 65
Context
Andrew Gresyk edited this page Apr 12, 2024
·
1 revision
-
Context is a user-defined type, for sharing data between user scope, and state methods.
struct Context {}; using Config = hfsm2::Config::ContextT<Context&>; using M = hfsm2::MachineT<Config>;
-
Set context type (can be a value, a reference or a pointer):
using Config = hfsm2::Config ::ContextT<TContext>; using M = hfsm2::MachineT<Config>;
Method | Description |
---|---|
Instance(const Context&); |
Construct FSM instance with context |
Context& Instance::context(); const Context& Instance::context() const;
|
Access context |
void Instance::setContext(const Context&); |
Assign context |