tbb::task_list Class Reference
Task Scheduling

A list of children. More...

`#include <task.h>`

Inheritance diagram for tbb::task_list:
Collaboration diagram for tbb::task_list:

## Public Member Functions

| task_list ()
| Construct empty list. More...
| ~task_list ()
| Destroys the list, but does not destroy the task objects. More...
bool | empty () const
| True if list is empty; false otherwise. More...
void | push_back (task &task)
| Push task onto back of list. More...
task & | pop_front ()
| Pop the front task from the list. More...
void | clear ()
| Clear the list. More...

## Private Attributes

task * | first
task ** | next_ptr

## Friends

class | task
class | interface5::internal::task_base

## Additional Inherited Members

Private Member Functions inherited from tbb::internal::no_copy
| no_copy (const no_copy &)=delete
| no_copy ()=default

## Detailed Description

A list of children.

Used for method task::spawn_children

Definition at line 1074 of file task.h.

## Constructor & Destructor Documentation

## task_list()

tbb::task_list::task_list | ( |  | ) |

inline

Construct empty list.

Definition at line 1082 of file task.h.

: first(NULL), next_ptr(&first) {}
tbb::task_list::next_ptr
task ** next_ptr
Definition: task.h:1077
tbb::task_list::first
task * first
Definition: task.h:1076

## ~task_list()

tbb::task_list::~task_list | ( |  | ) |

inline

Destroys the list, but does not destroy the task objects.

Definition at line 1085 of file task.h.

{}

## Member Function Documentation

## clear()

void tbb::task_list::clear | ( |  | ) |

inline

Clear the list.

Definition at line 1118 of file task.h.

{
first=NULL;
next_ptr=&first;
}

References tbb::internal::first().

Referenced by tbb::interface5::internal::task_base::spawn(), tbb::task::spawn_and_wait_for_all(), and tbb::task::spawn_root_and_wait().

Here is the call graph for this function:
Here is the caller graph for this function:

## empty()

bool tbb::task_list::empty | ( |  | ) | const

inline

True if list is empty; false otherwise.

Definition at line 1088 of file task.h.

{return !first;}

References tbb::internal::first().

Referenced by tbb::flow::interface11::async_node< Input, Output, Policy, Allocator >::try_put_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

## pop_front()

task& tbb::task_list::pop_front | ( |  | ) |

inline

Pop the front task from the list.

Definition at line 1109 of file task.h.

{
__TBB_ASSERT( !empty(), "attempt to pop item from empty task_list" );
task* result = first;
first = result->prefix().next;
if( !first ) next_ptr = &first;
return *result;
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::internal::task_prefix::next
tbb::task * next
"next" field for list of task
Definition: task.h:297
tbb::task::prefix
internal::task_prefix & prefix(internal::version_tag *=NULL) const
Get reference to corresponding task_prefix.
Definition: task.h:1002
tbb::task_list::task
friend class task
Definition: task.h:1078
tbb::task_list::empty
bool empty() const
True if list is empty; false otherwise.
Definition: task.h:1088

References __TBB_ASSERT, tbb::internal::first(), tbb::internal::task_prefix::next, and tbb::task::prefix().

Referenced by tbb::flow::interface11::async_node< Input, Output, Policy, Allocator >::try_put_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

## push_back()

void tbb::task_list::push_back | ( | task & | task | ) |

inline

Push task onto back of list.

Definition at line 1091 of file task.h.

{
task.prefix().next = NULL;
*next_ptr = &task;
next_ptr = &task.prefix().next;
}

References tbb::internal::task_prefix::next, tbb::task::prefix(), and task.

Referenced by tbb::interface9::internal::do_group_task_forward< Iterator, Body, Item >::execute(), tbb::interface9::internal::do_group_task_input< Body, Item >::execute(), tbb::internal::while_group_task< Body >::execute(), tbb::internal::pipeline_root_task::execute(), and tbb::interface9::internal::do_task_iter< Iterator, Body, Item >::run_for_random_access_iterator().

Here is the call graph for this function:
Here is the caller graph for this function:

## Friends And Related Function Documentation

## interface5::internal::task_base

friend class interface5::internal::task_base

friend

Definition at line 1079 of file task.h.

## task

friend class task

friend

Definition at line 1078 of file task.h.

## Member Data Documentation

## first

task* tbb::task_list::first

private

Definition at line 1076 of file task.h.

Referenced by tbb::interface5::internal::task_base::spawn(), tbb::task::spawn_and_wait_for_all(), and tbb::task::spawn_root_and_wait().

## next_ptr

task** tbb::task_list::next_ptr

private

Definition at line 1077 of file task.h.

Referenced by tbb::interface5::internal::task_base::spawn(), tbb::task::spawn_and_wait_for_all(), and tbb::task::spawn_root_and_wait().

The documentation for this class was generated from the following file:

- task.h

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.