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:
trueif the list is empty;false otherwise.-
push_back(task& task) Effects: inserts a reference to
taskat 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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access