31 #include "core/GpgFrontendCore.h"
32 #include "core/function/SecureMemoryAllocator.h"
33 #include "core/model/DataObject.h"
39 class GPGFRONTEND_CORE_EXPORT
Task :
public QObject,
public QRunnable {
44 using TaskRunnable = std::function<int(DataObjectPtr)>;
45 using TaskCallback = std::function<void(
int, DataObjectPtr)>;
55 auto GetTask() ->
Task*;
65 explicit Task(QString name);
72 explicit Task(TaskRunnable runnable, QString name,
73 DataObjectPtr data_object =
nullptr);
80 explicit Task(TaskRunnable runnable, QString name, DataObjectPtr data,
81 TaskCallback callback);
94 [[nodiscard]]
auto GetUUID() const -> QString;
101 [[nodiscard]] auto GetFullID() const -> QString;
108 void HoldOnLifeCycle(
bool hold_on);
115 virtual auto Run() ->
int;
122 [[nodiscard]] auto GetRTN();
144 void SignalTaskShouldEnd(
int);
150 void SignalTaskEnd();
158 void setRTN(
int rtn);
166 void slot_exception_safe_run() noexcept;
170 SecureUniquePtr<
Impl> p_;
Definition: TaskRunner.h:37
~Task() override
Destroy the Task object.
Executive files related to the basic operations of GPG.
Definition: ModuleManager.h:39