Moved insight worker and introduced worker tasks

This commit is contained in:
Nav
2021-08-30 22:17:59 +01:00
parent a52d2271b3
commit 3be8d90e09
7 changed files with 141 additions and 8 deletions

View 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();
};
}