GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
TaskRunnerGetter.h
1 
27 #ifndef GPGFRONTEND_TASKRUNNERGETTER_H
28 #define GPGFRONTEND_TASKRUNNERGETTER_H
29 
30 #include "core/GpgFrontendCore.h"
31 #include "core/GpgFunctionObject.h"
32 #include "core/thread/TaskRunner.h"
33 
34 namespace GpgFrontend::Thread {
35 
36 class GPGFRONTEND_CORE_EXPORT TaskRunnerGetter
37  : public GpgFrontend::SingletonFunctionObject<TaskRunnerGetter> {
38  public:
39  enum TaskRunnerType {
40  kTaskRunnerType_Default,
41  kTaskRunnerType_GPG,
42  kTaskRunnerType_IO,
43  kTaskRunnerType_Network,
44  };
45 
47 
48  TaskRunner *GetTaskRunner(
49  TaskRunnerType runner_type = kTaskRunnerType_Default);
50 
51  private:
52  std::map<TaskRunnerType, TaskRunner *> task_runners_;
53 };
54 
55 } // namespace GpgFrontend::Thread
56 
57 #endif // GPGFRONTEND_TASKRUNNERGETTER_H
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:148
GpgFrontend::Thread::TaskRunner
Definition: TaskRunner.h:39
GpgFrontend::Thread::TaskRunnerGetter
Definition: TaskRunnerGetter.h:36
GpgFrontend::Thread
Definition: CtxCheckTask.h:33
GpgFrontend::SingletonFunctionObject::GetDefaultChannel
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:232
GpgFrontend::Thread::TaskRunnerGetter::TaskRunnerGetter
TaskRunnerGetter(int channel=SingletonFunctionObject::GetDefaultChannel())
Definition: TaskRunnerGetter.cpp:29