Moved insight worker and introduced worker tasks
This commit is contained in:
37
src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp
Normal file
37
src/Insight/InsightWorker/Tasks/InsightWorkerTask.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include "src/TargetController/TargetControllerConsole.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
enum class InsightWorkerTaskState: std::uint8_t
|
||||
{
|
||||
CREATED,
|
||||
STARTED,
|
||||
FAILED,
|
||||
COMPLETED,
|
||||
};
|
||||
|
||||
class InsightWorkerTask: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
virtual void run(TargetControllerConsole& targetControllerConsole) = 0;
|
||||
|
||||
public:
|
||||
InsightWorkerTaskState state;
|
||||
|
||||
InsightWorkerTask() = default;
|
||||
InsightWorkerTask(QObject* parent): QObject(parent) {};
|
||||
|
||||
void execute(TargetControllerConsole& targetControllerConsole);
|
||||
|
||||
signals:
|
||||
void started();
|
||||
void failed(QString errorMessage);
|
||||
void completed();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user