Files
VisualSapfor/src/files/Planner/RunSupervisor.h

26 lines
779 B
C
Raw Normal View History

2023-12-03 19:43:41 +03:00
#pragma once
2023-09-17 22:13:42 +03:00
#include "CompilationSupervisor.h"
#include "RunTask.h"
2023-12-03 19:43:41 +03:00
class RunSupervisor : public Supervisor<RunTask> {
public:
RunSupervisor(CompilationSupervisor* compilationSupervisor) {
this->init("runTasks", 8);
2023-09-17 22:13:42 +03:00
//проверить отмененные задачи.
2023-12-03 19:43:41 +03:00
for (long i = 0; i < getLength(); ++i) {
RunTask* task = this->get(i);
CompilationTask* parent = compilationSupervisor->getTaskById(task->getTestCompilationTaskId());
task->setState((parent->getState() == Done) ? Waiting : Canceled);
task->setParent(parent);
2023-09-17 22:13:42 +03:00
printf("id=%ld; parent_id = %ld; state=%s\n",
2023-12-03 19:43:41 +03:00
task->getId(),
task->getParent()->getId(),
task->printState().getCharArray());
}
2023-09-17 22:13:42 +03:00
}
2023-12-03 19:43:41 +03:00
virtual String getStatePrefix() {
2023-09-17 22:13:42 +03:00
return String("Running");
}
2023-12-03 19:43:41 +03:00
};