13 #include "ErrorBase.h"
15 #include "support/deprecated.h"
23 "Task API scheduled for removal in 2018. Replace with std::thread, and use "
24 "Threads API for setting priority") Task :
public ErrorBase {
26 static const int kDefaultPriority = 60;
29 Task(
const Task&) =
delete;
30 Task& operator=(
const Task&) =
delete;
31 Task& operator=(Task&& task);
33 template <
class Function,
class... Args>
34 Task(
const std::string& name, Function&&
function, Args&&... args);
38 bool joinable() const noexcept;
41 std::thread::
id get_id() const noexcept;
42 std::thread::native_handle_type native_handle();
48 bool SetPriority(
int priority);
50 std::
string GetName() const;
54 std::
string m_taskName;
56 typedef int32_t TASK_STATUS;
58 static constexpr int32_t TASK_OK = 0;
59 static constexpr int32_t TASK_ERROR = -1;
60 static constexpr int32_t TaskLib_ILLEGAL_PRIORITY = 22;
62 bool HandleError(TASK_STATUS results);
63 TASK_STATUS VerifyTaskId();
64 TASK_STATUS GetTaskPriority(int32_t* priority);
65 TASK_STATUS SetTaskPriority(int32_t priority);
Base class for most objects.
Definition: ErrorBase.h:72