16 const std::string label;
21 label(
std::move(label_)),
27 auto state_snapshot = state.load();
28 if (state_ != state_snapshot)
30 throw std::logic_error(fmt::format(
31 "[{}] State is {}, but expected {}", label, state_snapshot, state_));
35 [[nodiscard]]
bool check(T state_)
const
37 return state_ == state.load();
Definition state_machine.h:15
void expect(T state_) const
Definition state_machine.h:25
T value() const
Definition state_machine.h:40
void advance(T state_)
Definition state_machine.h:45
StateMachine(std::string label_, T state_)
Definition state_machine.h:20
bool check(T state_) const
Definition state_machine.h:35
#define LOG_DEBUG_FMT
Definition internal_logger.h:14