|
TuringSim
C++ framework to simulate abstract computing models
|
3 #include <transition/transition.h>
15 template<
typename StateType_>
23 static_assert(std::is_same_v<StateType, StateType_>);
24 static_assert(std::is_same_v<StorageType, std::monostate>);
25 static_assert(std::is_same_v<ApplyHelperType, std::monostate>);
49 #pragma clang diagnostic push
50 #pragma clang diagnostic ignored "-Wunused-parameter"
58 virtual std::optional<ApplyHelperType>
86 #pragma clang diagnostic pop
virtual StateType apply(const StateType &state, StorageType &storage, ApplyHelperType &&helper, bool &running) const override final
Apply a previously matching transition and return the new state.
The transition base class for AmnesicMachine.
std::monostate ApplyHelperType
The type of apply helpers.
Transitions for amnesic machines.
virtual std::optional< ApplyHelperType > matchFromState(const StateType &state) const =0
Test whether the transition matches a configuration. Returned optional is empty iff the transition do...
AmnesicMachineTransition & operator=(const AmnesicMachineTransition &)=default
The default copy assignment operator.
virtual std::optional< ApplyHelperType > match(const StateType &state, const StorageType &storage) const override final
Test whether the transition matches a configuration. Returned optional is empty iff the transition do...
StateType_ StateType
The type of states.
Base class for transitions.
virtual ~AmnesicMachineTransition() override=default
The default virtual destructor.
AmnesicMachineTransition & operator=(AmnesicMachineTransition &&)=default
The default move assignment operator.
AmnesicMachineTransition(const AmnesicMachineTransition &)=default
The default copy constructor.
AmnesicMachineTransition(AmnesicMachineTransition &&)=default
The default move constructor.
AmnesicMachineTransition()=default
The default constructor.
virtual StateType applyFromState(const StateType &state, bool &running) const =0
Apply a previously matching transition and return the new state, without irrelevant parameters.
std::monostate StorageType
The type of storage.