Zth (libzth)
|
#include <fsm.h>
Public Types | |
typedef choose_type< FsmImpl_, FsmCallback< State_, CallbackArg_, Input_, void > >::type | FsmImpl |
typedef Fsm< State_, Input_, FsmImpl > | base |
typedef CallbackArg_ | CallbackArg |
typedef void(* | Callback) (FsmCallback &, CallbackArg) |
Public Types inherited from zth::Fsm< State_, int, choose_type< void, FsmCallback< State_, void, int, void > >::type > | |
typedef choose_type< choose_type< void, FsmCallback< State_, void, int, void > >::type, Fsm >::type | FsmImpl |
typedef State_ | State |
typedef int | Input |
typedef FsmCompiler< FsmImpl > | Compiler |
typedef FsmDescription< FsmImpl > | Description[] |
Public Member Functions | |
FsmCallback (typename base::Compiler const &compiler, Callback callback, CallbackArg callbackArg, char const *name="FSM") | |
FsmCallback (typename base::Description description, Callback callback, CallbackArg callbackArg, char const *name="FSM") | |
virtual | ~FsmCallback () |
CallbackArg | callbackArg () const |
Public Member Functions inherited from zth::Fsm< State_, int, choose_type< void, FsmCallback< State_, void, int, void > >::type > | |
Fsm (Compiler const &compiler, char const *name="FSM") | |
Fsm (Description description, char const *name="FSM") | |
virtual | ~Fsm () |
State const & | state () const |
Timestamp const & | t () const |
TimeInterval | dt () const |
State const & | next () const |
void | reset () |
bool | entry () const |
bool | exit () const |
bool | lockstep () const |
Check if lockstep mode is enabled. More... | |
void | setLockstep (bool enable) |
Enable/disable lockstep mode. More... | |
bool | guardLock () |
Check if a lock was requested while running in lockstep mode. More... | |
bool | guardStep () |
Check if a step was requested while paused in lockstep mode. More... | |
void | step () |
Allow the Fsm to proceed one step, if in lockstep mode. More... | |
void | input (Input i) |
bool | clearInput (Input i) |
void | clearInputs () |
void | setInputsCapacity (size_t capacity) |
bool | hasInput (Input i) const |
TimeInterval | eval (bool alwaysDoCallback=false) |
void | run () |
void | trigger () |
Public Member Functions inherited from zth::UniqueID< Fsm< void, void, void > > | |
UniqueID (UniqueID const &)=delete | |
UniqueID (UniqueID &&u) noexcept | |
UniqueID (string const &name) | |
UniqueID (string &&name) | |
UniqueID (char const *name=nullptr) | |
UniqueID & | operator= (UniqueID const &)=delete |
UniqueID & | operator= (UniqueID &&u) noexcept |
virtual | ~UniqueID ()=default |
void const * | normptr () const noexcept |
uint64_t | id () const noexcept |
string const & | name () const noexcept |
void | setName (string const &name) |
void | setName (char const *name) |
void | setName (string &&name) |
virtual char const * | id_str () const override |
Protected Member Functions | |
virtual void | callback () override |
This function is called when the FSM has to execute the code belonging by the current state. More... | |
Protected Member Functions inherited from zth::UniqueIDBase | |
virtual | ~UniqueIDBase ()=default |
Additional Inherited Members | |
Static Public Member Functions inherited from zth::UniqueID< Fsm< void, void, void > > | |
static uint64_t | getID () noexcept |
Public Attributes inherited from zth::Fsm< State_, int, choose_type< void, FsmCallback< State_, void, int, void > >::type > | |
FsmDescription< FsmImpl > * | m_description |
Compiler const * | m_compiler |
FsmDescription< FsmImpl > const * | m_compiledDescription |
Protected Types inherited from zth::Fsm< State_, int, choose_type< void, FsmCallback< State_, void, int, void > >::type > | |
enum | EvalState |
enum | Lockstep |
typedef FsmDescription< FsmImpl > const * | StateAddr |
typedef Fsm<State_, Input_, FsmImpl> zth::FsmCallback< State_, CallbackArg_, Input_, FsmImpl_ >::base |
typedef void(* zth::FsmCallback< State_, CallbackArg_, Input_, FsmImpl_ >::Callback) (FsmCallback &, CallbackArg) |
typedef CallbackArg_ zth::FsmCallback< State_, CallbackArg_, Input_, FsmImpl_ >::CallbackArg |
typedef choose_type< FsmImpl_, FsmCallback<State_, CallbackArg_, Input_, void> >::type zth::FsmCallback< State_, CallbackArg_, Input_, FsmImpl_ >::FsmImpl |
|
inline |
|
inline |
|
inlinevirtual |
|
inlineoverrideprotectedvirtual |
This function is called when the FSM has to execute the code belonging by the current state.
It is called upon entry and exit of a state, and arbitrary times during a state.
Implements zth::Fsm< State_, int, choose_type< void, FsmCallback< State_, void, int, void > >::type >.
|
inline |