15 #include "ErrorBase.h"
17 #include "support/deprecated.h"
25 "Task API scheduled for removal in 2018. Replace with std::thread, and use "
26 "Threads API for setting priority") Task :
public ErrorBase {
28 static const int kDefaultPriority = 60;
31 Task(
const Task&) =
delete;
32 Task& operator=(
const Task&) =
delete;
33 Task& operator=(Task&& task);
35 template <
class Function,
class... Args>
36 Task(
const std::string& name, Function&&
function, Args&&... args);
40 bool joinable() const noexcept;
43 std::thread::
id get_id() const noexcept;
44 std::thread::native_handle_type native_handle();
50 bool SetPriority(
int priority);
52 std::
string GetName() const;
56 std::
string m_taskName;
58 typedef int32_t TASK_STATUS;
60 static constexpr int32_t TASK_OK = 0;
61 static constexpr int32_t TASK_ERROR = -1;
62 static constexpr int32_t TaskLib_ILLEGAL_PRIORITY = 22;
64 bool HandleError(TASK_STATUS results);
65 TASK_STATUS VerifyTaskId();
66 TASK_STATUS GetTaskPriority(int32_t* priority);
67 TASK_STATUS SetTaskPriority(int32_t priority);
Base class for most objects.
Definition: ErrorBase.h:72