Name
task_list Class — List of task objects.
Synopsis
#include "tbb/task.h" class task_list;
Description
A task_list
is a list of references to task objects. The purpose of task_list
is to allow a task to create a list of child tasks and spawn them all at once via the method task:: spawn(task_list&)
. A task can belong to, at most, one task_list
at a time, and can be on that task_list
once at most. A task that has been spawned but has not started running must not belong to a task_list
. A task_list
cannot be copy-constructed or assigned.
Members
namespace tbb { class task_list { public: task_list(); ~task_list(); bool empty() const; void push_back( task& task ); task& pop_front(); void clear(); }; }
-
task_list()
Effects: constructs an empty list.
-
~task_list()
Effects: destroys the list. Does not destroy the task objects.
-
bool empty()const
Returns:
true
if the list is empty;fals
e otherwise.-
push_back(task& task)
Effects: inserts a reference to
task
at the back of the list.-
task& task pop_front()
Effects: removes a task reference from the front of the list.
Returns: the reference that was removed.
-
void clear()
Effects: removes all task references from the list. Does not destroy the task objects.
Get Intel Threading Building Blocks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.