GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
TaskRunner.h
1 
29 #pragma once
30 
31 #include "core/GpgFrontendCore.h"
32 #include "core/function/SecureMemoryAllocator.h"
33 #include "core/thread/Task.h"
34 
35 namespace GpgFrontend::Thread {
36 
37 class GPGFRONTEND_CORE_EXPORT TaskRunner : public QObject {
38  Q_OBJECT
39  public:
44  TaskRunner();
45 
50  ~TaskRunner() override;
51 
56  void Start();
57 
62  void Stop();
63 
69  auto GetThread() -> QThread*;
70 
77  auto IsRunning() -> bool;
78 
84  void PostTask(Task* task);
85 
92  void PostTask(const QString&, const Task::TaskRunnable&,
93  const Task::TaskCallback&, DataObjectPtr);
94 
100  auto RegisterTask(const QString&, const Task::TaskRunnable&,
101  const Task::TaskCallback&, DataObjectPtr)
103 
109  void PostConcurrentTask(Task* task);
110 
117  void PostScheduleTask(Task* task, size_t seconds);
118 
119  private:
120  class Impl;
121  SecureUniquePtr<Impl> p_;
122 };
123 } // namespace GpgFrontend::Thread
Definition: TaskRunner.cpp:35
Definition: TaskRunner.h:37
Definition: Task.h:39
Definition: ModuleManager.h:39