checkpoint
This commit is contained in:
parent
4c6c4b8a22
commit
3c876211c2
35 changed files with 365 additions and 207 deletions
27
ass2/simulator/executor.cpp
Normal file
27
ass2/simulator/executor.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "executor.h"
|
||||
#include "machine.cpp"
|
||||
#include<chrono>
|
||||
#include<thread>
|
||||
|
||||
Executor::Executor() {}
|
||||
|
||||
void Executor::start() {
|
||||
running = true;
|
||||
while (running) {
|
||||
machine->execute();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Executor::stop() {
|
||||
running = false;
|
||||
}
|
||||
|
||||
bool Executor::isRunning() {
|
||||
return running;
|
||||
}
|
||||
|
||||
void Executor::step() {
|
||||
machine->execute();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue