FSM is now even cleaner, as long as you don't look at that CPP macro.
This commit is contained in:
parent
c9425aebf9
commit
f632f2d5af
6 changed files with 51 additions and 53 deletions
4
fsm.hpp
4
fsm.hpp
|
@ -3,9 +3,9 @@
|
|||
#include <fmt/core.h>
|
||||
|
||||
#ifndef FSM_DEBUG
|
||||
#define FSM_STATE(C, S, F, E, ...) case C::S: F(E, ##__VA_ARGS__); break
|
||||
#define FSM_STATE(C, S, E, ...) case C::S: S(E, ##__VA_ARGS__); break
|
||||
#else
|
||||
#define FSM_STATE(C, S, F, E, ...) case C::S: fmt::println(">> " #C " " #S ":" #F " event={}, state={}", int(E), int(_state)); F(E, ##__VA_ARGS__); fmt::println("<< " #C " state={}", int(_state)); break
|
||||
#define FSM_STATE(C, S, E, ...) case C::S: fmt::println(">> " #C " " #S " event={}, state={}", int(E), int(_state)); S(E, ##__VA_ARGS__); fmt::println("<< " #C " state={}", int(_state)); break
|
||||
#endif
|
||||
|
||||
template<typename S, typename E>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue