Maki
Loading...
Searching...
No Matches
maki Namespace Reference

The Maki library. More...

Namespaces

namespace  events
 Some predefined events emitted by Maki itself.
 
namespace  states
 Predefined state and pseudostate objects.
 

Classes

struct  action
 Represents an action to be given to maki::transition_table. More...
 
class  event_set
 Represents an event type set. More...
 
struct  event_t
 Holds an event type. More...
 
struct  guard
 Represents a guard to be given to maki::transition_table. Use the builder functions (maki::guard_v() and its variants) instead of using this type directly. More...
 
class  machine
 The state machine implementation template. More...
 
class  machine_conf
 maki::machine configuration More...
 
class  machine_ref
 A type-erasing container for a reference to a machine of any type. More...
 
struct  machine_ref_conf
 The configuration for maki::machine_ref More...
 
class  path
 Encodes a path to a state or region. More...
 
class  region
 Represents an region. More...
 
class  state
 Represents a state. More...
 
class  state_builder
 State builder. More...
 
class  state_set
 Represents a state set. More...
 
class  transition_table
 Represents a transition table. More...
 

Typedefs

using final_t = IMPLEMENTATION_DETAIL
 The type of maki::final
 
using init_t = IMPLEMENTATION_DETAIL
 The type of maki::init
 
using null_t = IMPLEMENTATION_DETAIL
 The type of maki::null
 

Enumerations

enum class  action_signature : char {
  v , c , cm , cme ,
  ce , m , me , e
}
 The set of arguments taken by an action callable. More...
 
enum class  guard_signature : char {
  v , c , cm , cme ,
  ce , m , me , e
}
 The set of arguments taken by a guard callable. More...
 
enum class  machine_context_signature : char { a , am }
 The set of arguments taken by the constructor of a machine context. More...
 
enum class  state_context_signature : char { v , c , cm , m }
 The set of arguments taken by the constructor of a state context. More...
 

Functions

template<class Event>
 event_set (event_t< Event >) -> event_set< IMPLEMENTATION_DETAIL >
 Class template argument deduction guide for maki::event_set.
 
template<class Callable>
constexpr action< action_signature::c, Callable > action_c (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr action< action_signature::ce, Callable > action_ce (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr action< action_signature::cm, Callable > action_cm (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr action< action_signature::cme, Callable > action_cme (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr action< action_signature::e, Callable > action_e (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr action< action_signature::m, Callable > action_m (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr action< action_signature::me, Callable > action_me (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr action< action_signature::v, Callable > action_v (const Callable &callable)
 Makes a maki::action with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::c, Callable > guard_c (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::ce, Callable > guard_ce (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::cm, Callable > guard_cm (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::cme, Callable > guard_cme (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::e, Callable > guard_e (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::m, Callable > guard_m (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::me, Callable > guard_me (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Callable>
constexpr guard< guard_signature::v, Callable > guard_v (const Callable &callable)
 Makes a maki::guard with the indicated signature and given callable.
 
template<class Predicate>
constexpr auto operator! (const event_set< Predicate > &evt_set)
 Creates a maki::event_set that contains all the event types that are not contained in evt_set.
 
template<class Event>
constexpr auto operator! (event_t< Event >)
 Creates a maki::event_set that contains all the event types but Event.
 
template<guard_signature Signature, class Callable>
constexpr auto operator! (const guard< Signature, Callable > &grd)
 Makes a maki::guard that returns true if grd returns false.
 
template<class StateBuilderImpl>
constexpr auto operator! (const state_builder< StateBuilderImpl > &stt_builder)
 Creates a maki::state_set that contains all the states but the ones created by stt_builder.
 
template<class Impl>
constexpr auto operator! (const state_set< Impl > &stt_set)
 Creates a maki::state_set that contains all the states that are not contained in stt_set.
 
template<guard_signature LhsSignature, class LhsCallable, guard_signature RhsSignature, class RhsCallable>
constexpr auto operator!= (const guard< LhsSignature, LhsCallable > &lhs, const guard< RhsSignature, RhsCallable > &rhs)
 Makes a maki::guard that returns true if exactly one of lhs or rhs returns true.
 
template<class LhsImpl, class RhsImpl>
constexpr auto operator&& (const event_set< LhsImpl > &lhs, const event_set< RhsImpl > &rhs)
 Creates a maki::event_set that is the result of the intersection of lhs and rhs.
 
template<guard_signature LhsSignature, class LhsCallable, guard_signature RhsSignature, class RhsCallable>
constexpr auto operator&& (const guard< LhsSignature, LhsCallable > &lhs, const guard< RhsSignature, RhsCallable > &rhs)
 Makes a maki::guard that returns true if lhs and rhs return true.
 
template<class LhsImpl, class RhsImpl>
constexpr auto operator&& (const state_set< LhsImpl > &lhs, const state_set< RhsImpl > &rhs)
 Creates a maki::state_set that is the result of the intersection of lhs and rhs.
 
template<class T, class U>
constexpr bool operator== (const event_t< T >, const event_t< U >)
 Returns whether T and U are the same type.
 
template<class EventSetPredicate, class Event>
constexpr auto operator|| (const event_set< EventSetPredicate > &evt_set, event_t< Event >)
 Creates a maki::event_set that contains the content of evt_set, plus Event.
 
template<class LhsImpl, class RhsImpl>
constexpr auto operator|| (const event_set< LhsImpl > &lhs, const event_set< RhsImpl > &rhs)
 Creates a maki::event_set that is the result of the union of lhs and rhs.
 
template<class Event, class EventSetPredicate>
constexpr auto operator|| (const event_t< Event > evt, const event_set< EventSetPredicate > &evt_set)
 Creates a maki::event_set that contains the content of evt_set, plus Event.
 
template<class LhsEvent, class RhsEvent>
constexpr auto operator|| (event_t< LhsEvent >, event_t< RhsEvent >)
 Creates a maki::event_set that contains LhsEvent and RhsEvent.
 
template<guard_signature LhsSignature, class LhsCallable, guard_signature RhsSignature, class RhsCallable>
constexpr auto operator|| (const guard< LhsSignature, LhsCallable > &lhs, const guard< RhsSignature, RhsCallable > &rhs)
 Makes a maki::guard that returns true if lhs or rhs returns true.
 
template<class LhsStateBuilderImpl, class RhsStateBuilderImpl>
constexpr auto operator|| (const state_builder< LhsStateBuilderImpl > &lhs, const state_builder< RhsStateBuilderImpl > &rhs)
 Creates a maki::state_set that contains the states created from lhs and rhs.
 
template<class StateBuilderImpl, class StateSetImpl>
constexpr auto operator|| (const state_builder< StateBuilderImpl > &stt_builder, const state_set< StateSetImpl > &stt_set)
 Creates a maki::state_set that contains the states of stt_set, plus the ones created by stt_builder.
 
template<class LhsImpl, class RhsImpl>
constexpr auto operator|| (const state_set< LhsImpl > &lhs, const state_set< RhsImpl > &rhs)
 Creates a maki::state_set that is the result of the union of lhs and rhs.
 
template<class StateSetImpl, class StateBuilderImpl>
constexpr auto operator|| (const state_set< StateSetImpl > &stt_set, const state_builder< StateBuilderImpl > &stt_builder)
 Creates a maki::state_set that contains the states of stt_set, plus the ones created by stt_builder.
 

Variables

template<class... Events>
constexpr auto machine_ref_e_conf
 
constexpr auto undefined = state_builder{}
 The state builder of the undefined state.
 

Detailed Description

The Maki library.

Enumeration Type Documentation

◆ action_signature

enum class maki::action_signature : char
strong

The set of arguments taken by an action callable.

Enumerator

void action()

void action(context&)

cm 

void action(context&, machine&)

cme 

void action(context&, machine&, const event&)

ce 

void action(context&, const event&)

void action(machine&)

me 

void action(machine&, const event&)

void action(const event&)

◆ guard_signature

enum class maki::guard_signature : char
strong

The set of arguments taken by a guard callable.

Enumerator

bool guard()

bool guard(const context&)

cm 

bool guard(const context&, const machine&)

cme 

bool guard(const context&, const machine&, const event&)

ce 

bool guard(const context&, const event&)

bool guard(const machine&)

me 

bool guard(const machine&, const event&)

bool guard(const event&)

◆ machine_context_signature

enum class maki::machine_context_signature : char
strong

The set of arguments taken by the constructor of a machine context.

Enumerator

context(MachineConstructorArgs&&...)

am 

context(MachineConstructorArgs&&..., machine&)

◆ state_context_signature

enum class maki::state_context_signature : char
strong

The set of arguments taken by the constructor of a state context.

Enumerator

context()

context(context&)

cm 

context(context&, machine&)

context(machine&)

Variable Documentation

◆ machine_ref_e_conf

template<class... Events>
auto maki::machine_ref_e_conf
constexpr
Initial value:
.events<Events...>()
The configuration for maki::machine_ref
Definition machine_ref_conf.hpp:29
constexpr auto events() const
Sets the event types that can be passed to maki::machine_ref::process_event().
Definition machine_ref_conf.hpp:47