Zth (libzth)

Classes

class  zth::FsmGuard< Fsm >
 A guard is evaluated, and when true, the corresponding transition is taken. More...
 
struct  zth::FsmDescription< Fsm >
 The description of a Fsm. More...
 
class  zth::FsmCompiler< Fsm >
 A compiler to turn an zth::FsmDescription into something that can be used by zth::Fsm. More...
 
class  zth::Fsm< State_, Input_, FsmImpl_ >
 A Finite-state machine. More...
 

Functions

template<typename Fsm >
TimeInterval zth::guards::always (Fsm &fsm)
 A guard that is always true. More...
 
template<typename FsmInput , typename FsmInput::Input i, typename Fsm >
TimeInterval zth::guards::input (Fsm &fsm)
 A guard that is true when the given input has been set. More...
 
template<typename FsmInput , typename FsmInput::Input i, typename Fsm >
TimeInterval zth::guards::peek (Fsm &fsm)
 A guard that is true when the given input has been set. More...
 
template<time_t s, typename Fsm >
TimeInterval zth::guards::timeout_s (Fsm &fsm)
 A guard that is true when the Fsm stayed for the given time in this state. More...
 
template<unsigned int ms, typename Fsm >
TimeInterval zth::guards::timeout_ms (Fsm &fsm)
 A guard that is true when the Fsm stayed for the given time in this state. More...
 
template<uint64_t us, typename Fsm >
TimeInterval zth::guards::timeout_us (Fsm &fsm)
 A guard that is true when the Fsm stayed for the given time in this state. More...
 
template<typename Fsm >
TimeInterval zth::guards::lock (Fsm &fsm)
 A wrapper for zth::Fsm::guardLock(). More...
 
template<typename Fsm >
TimeInterval zth::guards::step (Fsm &fsm)
 A wrapper for zth::Fsm::guardStep(). More...
 

Detailed Description

Deprecated:
This FSM is superseded by the zth::fsm::compile() and friends.
See also
fsm14.h

Function Documentation

◆ always()

template<typename Fsm >
TimeInterval zth::guards::always ( Fsm fsm)

A guard that is always true.

Definition at line 53 of file fsm.h.

◆ input()

template<typename FsmInput , typename FsmInput::Input i, typename Fsm >
TimeInterval zth::guards::input ( Fsm fsm)

A guard that is true when the given input has been set.

If set, the input is cleared from the Fsm.

See also
zth::guards::peek()
Examples
fsm14.cpp.

Definition at line 66 of file fsm.h.

◆ lock()

template<typename Fsm >
TimeInterval zth::guards::lock ( Fsm fsm)

A wrapper for zth::Fsm::guardLock().

Definition at line 138 of file fsm.h.

◆ peek()

template<typename FsmInput , typename FsmInput::Input i, typename Fsm >
TimeInterval zth::guards::peek ( Fsm fsm)

A guard that is true when the given input has been set.

The input is not cleared from the Fsm.

See also
zth::guards::input()

Definition at line 82 of file fsm.h.

◆ step()

template<typename Fsm >
TimeInterval zth::guards::step ( Fsm fsm)

A wrapper for zth::Fsm::guardStep().

Definition at line 152 of file fsm.h.

◆ timeout_ms()

template<unsigned int ms, typename Fsm >
TimeInterval zth::guards::timeout_ms ( Fsm fsm)

A guard that is true when the Fsm stayed for the given time in this state.

Definition at line 116 of file fsm.h.

◆ timeout_s()

template<time_t s, typename Fsm >
TimeInterval zth::guards::timeout_s ( Fsm fsm)

A guard that is true when the Fsm stayed for the given time in this state.

Definition at line 105 of file fsm.h.

◆ timeout_us()

template<uint64_t us, typename Fsm >
TimeInterval zth::guards::timeout_us ( Fsm fsm)

A guard that is true when the Fsm stayed for the given time in this state.

Definition at line 127 of file fsm.h.