|
TuringSim
C++ framework to simulate abstract computing models
|
3 #include <machine/machine.h>
4 #include <listener/listener.h>
15 template<
typename MachineType,
typename Enable =
void>
22 template<
typename MachineType_>
52 template<
typename MachineType_>
92 template <
typename MachineType,
typename ListenerType>
109 template <
typename MachineType>
131 template <
typename MachineType_,
typename ListenerType_>
171 static_assert(std::is_same_v<typename ListenerType::MachineType, MachineType>,
172 "The listener must be made for the same machine type as the runner.");
174 "The listener must be a derived class of TuringSim::Runner::Listener");
215 virtual void step(
size_t nbIter = 1) = 0;
242 template <
typename MachineType_>
319 virtual void step(
size_t nbIter = 1) = 0;
Internal class to add a "void accept()" member for accepting machines.
constexpr MachineRunner & operator=(const MachineRunner &other)=default
Copy a runner.
MachineRunner_accepting_impl()=default
The default constructor.
const MachineType & machine
The simulated machine.
MachineType::ApplyHelperType ApplyHelperType
The type of transitions apply helpers of the machine.
virtual void exec()=0
Run the machine until it halts.
MachineType::ApplyHelperType ApplyHelperType
The type of transitions apply helpers of the machine.
void ListenerType
The type of the listener. Compatibility with the case where there is a listener.
MachineRunner_accepting_impl & operator=(const MachineRunner_accepting_impl &)=default
The default copy assignment operator.
MachineType::StateType StateType
The type of states of the machine.
MachineRunner_accepting_impl & operator=(const MachineRunner_accepting_impl &)=default
The default copy assignment operator.
virtual void oneStep()=0
Execute one step of the machine.
void ListenerIdType
The type of identifiers of the listener. Compatibility with the case where there is a listener.
Provides types to use in constructors for generic versions.
MachineRunner_accepting_impl(const MachineRunner_accepting_impl &)=default
The default copy constructor.
virtual void oneStep()=0
Execute one step of the machine.
MachineType::TransitionType TransitionType
The type of transitions of the machine.
The base class for listeners.
MachineRunner_accepting_impl & operator=(MachineRunner_accepting_impl &&)=default
The default move assignment operator.
The namespace of machine runners.
ListenerType & listener
The listener.
MachineRunner(const MachineType &machine, ListenerType &listener)
Construct a MachineRunner from a Machine.
MachineType::StateType StateType
The type of states of the machine.
constexpr MachineRunner(const MachineRunner &other)=default
Copy a runner.
constexpr MachineRunner(MachineRunner &&other)=default
Move a runner.
MachineRunner_accepting_impl(const MachineRunner_accepting_impl &)=default
The default copy constructor.
constexpr MachineRunner & operator=(const MachineRunner &other)=default
Copy a runner.
std::tuple< const MachineType & > ConstructorArgs
The tuple of parameters of a runner without listener.
virtual void step(size_t nbIter=1)=0
Execute a given number of steps of the machine, one step by default.
MachineRunner_accepting_impl(MachineRunner_accepting_impl &&)=default
The default move constructor.
constexpr MachineRunner(MachineRunner &&other)=default
Move a runner.
virtual void exec()=0
Run the machine until it halts.
MachineType::TransitionType TransitionType
The type of transitions of the machine.
constexpr MachineRunner(const MachineRunner &other)=default
Copy a runner.
std::tuple< const MachineType &, ListenerType & > ConstructorArgs
The tuple of parameters of a runner.
ListenerType_ ListenerType
The type of the listener.
virtual ~MachineRunner_accepting_impl()=default
The default virtual destructor.
const MachineType & machine
The simulated machine.
virtual bool accept()=0
Run the machine until it can decide acceptance.
constexpr MachineRunner & operator=(MachineRunner &&other)=default
Move a runner.
MachineRunner(const MachineType &machine)
Construct a MachineRunner from a Machine.
std::tuple ListenerConstructorArgs
The tuple of parameters of a runner, excluding the machine parameter.
virtual ~MachineRunner_accepting_impl()=default
The default virtual destructor.
MachineRunner_accepting_impl & operator=(MachineRunner_accepting_impl &&)=default
The default move assignment operator.
MachineType::StorageType StorageType
The type of the memory of the machine.
virtual ~MachineRunner() override=default
Destroy the runner.
std::tuple< ListenerType & > ListenerConstructorArgs
The tuple of parameters of a runner, excluding the machine parameter.
virtual ~MachineRunner() override=default
Destroy the runner.
virtual void step(size_t nbIter=1)=0
Execute a given number of steps of the machine, one step by default.
MachineRunner_accepting_impl(MachineRunner_accepting_impl &&)=default
The default move constructor.
constexpr MachineRunner & operator=(MachineRunner &&other)=default
Move a runner.
ListenerType::IdType ListenerIdType
The type of identifiers used by the listener.
MachineType::StorageType StorageType
The type of the memory of the machine.
A class to run a simulate the execution of a Machine.
MachineType_ MachineType
The type of the simulated machine.
MachineRunner_accepting_impl()=default
The default constructor.
MachineType_ MachineType
The type of the simulated machine.