task_handle¶
[scheduler.task_handle]
An instance of task_handle type owns a deferred task object.
namespace oneapi {
namespace tbb {
class task_handle {
public:
task_handle();
task_handle(task_handle&& src);
~task_handle();
task_handle& operator=(task_handle&& src);
explicit operator bool() const noexcept;
};
bool operator==(task_handle const& h, std::nullptr_t) noexcept;
bool operator==(std::nullptr_t, task_handle const& h) noexcept;
bool operator!=(task_handle const& h, std::nullptr_t) noexcept;
bool operator!=(std::nullptr_t, task_handle const& h) noexcept;
} // namespace tbb
} // namespace oneapi
Member Functions¶
-
task_handle()¶
Creates an empty
task_handleobject.
-
task_handle(task_handle &&src)¶
Constructs
task_handleobject with the content ofsrcusing move semantics.srcbecomes empty after the construction.
-
~task_handle()¶
Destroys the
task_handleobject and associated task if it exists.
-
task_handle &operator=(task_handle &&src)¶
Replaces the content of
task_handleobject with the content ofsrcusing move semantics.srcbecomes empty after the assignment. The previously associated task object, if any, is destroyed before the assignment.Returns: Reference to
*this.
-
explicit operator bool() const noexcept¶
Checks if
*thishas an associated task object.Returns:
trueif*thisis not empty,falseotherwise.
Non-Member Functions¶
bool operator==(task_handle const& h, std::nullptr_t) noexcept
bool operator==(std::nullptr_t, task_handle const& h) noexcept
Returns: true if h is empty, false otherwise.
bool operator!=(task_handle const& h, std::nullptr_t) noexcept
bool operator!=(std::nullptr_t, task_handle const& h) noexcept
Returns: true if h is not empty, false otherwise.