12#ifndef MAKI_ACTION_HPP
13#define MAKI_ACTION_HPP
15#include "detail/signature_macros.hpp"
16#include "detail/call.hpp"
58template<action_signature Sig,
class Callable>
65#define MAKI_DETAIL_X(name) \
71 template<class Callable> \
72 constexpr action<action_signature::name, Callable> action_##name(const Callable& callable) \
76MAKI_DETAIL_ACTION_SIGNATURES
81 inline constexpr auto null_action =
action_v([]{});
83 template<action_signature Sig,
class Callable>
89 constexpr const auto& to_action(
null_t )
97 static constexpr auto value =
false;
100 template<action_signature Sig,
class Callable>
101 struct is_action<
action<Sig, Callable>>
103 static constexpr auto value =
true;
107 constexpr bool is_action_v = is_action<T>::value;
124 call_callable<action_signature, Action::signature>
IMPLEMENTATION_DETAIL null_t
The type of maki::null
Definition null.hpp:26
action_signature
The set of arguments taken by an action callable.
Definition action.hpp:26
@ c
void action(context&)
Definition action.hpp:31
@ m
void action(machine&)
Definition action.hpp:43
@ cm
void action(context&, machine&)
Definition action.hpp:34
@ cme
void action(context&, machine&, const event&)
Definition action.hpp:37
@ ce
void action(context&, const event&)
Definition action.hpp:40
@ v
void action()
Definition action.hpp:28
@ me
void action(machine&, const event&)
Definition action.hpp:46
@ e
void action(const event&)
Definition action.hpp:49
Represents an action to be given to maki::transition_table.
Definition action.hpp:60
constexpr action< action_signature::v, Callable > action_v(const Callable &callable)
Makes a maki::action with the indicated signature and given callable.
Definition action.hpp:72