TaskRunnerGetter.h
#ifndef GPGFRONTEND_TASKRUNNERGETTER_H
#define GPGFRONTEND_TASKRUNNERGETTER_H
#include "core/GpgFrontendCore.h"
#include "core/GpgFunctionObject.h"
#include "core/thread/TaskRunner.h"
namespace GpgFrontend::Thread {
class GPGFRONTEND_CORE_EXPORT TaskRunnerGetter
: public GpgFrontend::SingletonFunctionObject<TaskRunnerGetter> {
public:
enum TaskRunnerType {
kTaskRunnerType_Default,
kTaskRunnerType_GPG,
kTaskRunnerType_IO,
kTaskRunnerType_Network,
};
TaskRunnerGetter(int channel = SingletonFunctionObject::GetDefaultChannel());
TaskRunner *GetTaskRunner(
TaskRunnerType runner_type = kTaskRunnerType_Default);
private:
std::map<TaskRunnerType, TaskRunner *> task_runners_;
};
} // namespace GpgFrontend::Thread
#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