[For complete, up-to-date TBB information visit: http://www.ThreadingBuildingBlocks.org]

TbbRef (Ver. 20): 8.5 task_list Class

8.5 task_list Class

Summary

List of task objects.

Syntax

class task_list;

Header

#include "tbb/task.h"

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&), as described in 8.3.6.4.

A task can belong to at most one task_list at a time, and on that task_list at most once. A task that has been spawned, but 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();

};

}

8.5.1 task_list()

Effects

Constructs an empty list.

8.5.2 ~task_list()

Effects

Destroys the list. Does not destroy the task objects.

8.5.3 bool empty() const

Returns

True if list is empty; false otherwise.

8.5.4 push_back( task& task )

Effects

Inserts a reference to task at back of the list.

8.5.5 task& task pop_front()

Effects

Removes a task reference from front of list.

Returns

[For complete, up-to-date TBB information visit: http://www.ThreadingBuildingBlocks.org]