18#ifndef INCLUDED_THREADING_TASKMANAGER
19#define INCLUDED_THREADING_TASKMANAGER
80 const std::unique_ptr<Impl>
m;
Corresponds to std::future.
Definition: Future.h:151
PackagedTask< Callback > Wrap(Callback &&callback)
Make the future wait for the result of callback.
Definition: Future.h:297
The task manager creates all worker threads on initialisation, and manages the task queues.
Definition: TaskManager.h:40
TaskManager(const TaskManager &)=delete
static TaskManager & Instance()
Definition: TaskManager.cpp:245
TaskManager()
Definition: TaskManager.cpp:163
const std::unique_ptr< Impl > m
Definition: TaskManager.h:80
TaskManager & operator=(TaskManager &&)=delete
void ClearQueue()
Clears all tasks from the queue.
Definition: TaskManager.cpp:182
TaskManager(TaskManager &&)=delete
static void Initialise()
Definition: TaskManager.cpp:239
Future< std::invoke_result_t< T > > PushTask(T &&func, TaskPriority priority=TaskPriority::NORMAL)
Push a task to be executed.
Definition: TaskManager.h:67
TaskManager & operator=(const TaskManager &)=delete
size_t GetNumberOfWorkers() const
Definition: TaskManager.cpp:195
void DoPushTask(std::function< void()> &&task, TaskPriority priority)
Definition: TaskManager.cpp:200
Worker thread: process the taskManager queues until killed.
Definition: TaskManager.cpp:98
Light-weight threading utilities.
Definition: TaskManager.cpp:38
TaskPriority
Definition: TaskManager.h:29
#define T(string_literal)
Definition: secure_crt.cpp:77