tbb::task_handle< F > Class Template Reference

`#include <task_group.h>`

Inheritance diagram for tbb::task_handle< F >:
Collaboration diagram for tbb::task_handle< F >:

## Public Member Functions

| task_handle (const F &f)
| task_handle (F &&f)
void | operator() () const

## Private Member Functions

void | mark_scheduled ()
Private Member Functions inherited from tbb::internal::no_assign
void | operator= (const no_assign &)=delete
| no_assign (const no_assign &)=default
| no_assign ()=default

## Private Attributes

F | my_func
intptr_t | my_state

## Static Private Attributes

static const intptr_t | scheduled = 0x1

## Friends

template<typename _F >
class | internal::task_handle_task
class | task_group
class | structured_task_group

## Detailed Description

### template<typename F>
class tbb::task_handle< F >

Definition at line 45 of file task_group.h.

## Constructor & Destructor Documentation

## task_handle() [1/2]

template<typename F>

tbb::task_handle< F >::task_handle | ( | const F & | f | ) |

inline

Definition at line 65 of file task_group.h.

: my_func(f), my_state(0) {}

## task_handle() [2/2]

template<typename F>

tbb::task_handle< F >::task_handle | ( | F && | f | ) |

inline

Definition at line 67 of file task_group.h.

: my_func( std::move(f)), my_state(0) {}

## Member Function Documentation

## mark_scheduled()

template<typename F>

void tbb::task_handle< F >::mark_scheduled | ( |  | ) |

inline private

Definition at line 58 of file task_group.h.

{
// The check here is intentionally lax to avoid the impact of interlocked operation
if ( my_state & scheduled )
internal::throw_exception( internal::eid_invalid_multiple_scheduling );
my_state |= scheduled;
}

References tbb::internal::eid_invalid_multiple_scheduling, tbb::task_handle< F >::my_state, tbb::task_handle< F >::scheduled, and tbb::internal::throw_exception().

Here is the call graph for this function:

## operator()()

template<typename F>

void tbb::task_handle< F >::operator() | ( |  | ) | const

inline

Definition at line 70 of file task_group.h.

{ my_func(); }

References tbb::task_handle< F >::my_func.

## Friends And Related Function Documentation

## internal::task_handle_task

template<typename F>
template<typename _F >

friend class internal::task_handle_task

friend

Definition at line 46 of file task_group.h.

## structured_task_group

template<typename F>

friend class structured_task_group

friend

Definition at line 48 of file task_group.h.

## task_group

template<typename F>

friend class task_group

friend

Definition at line 47 of file task_group.h.

## Member Data Documentation

## my_func

template<typename F>

F tbb::task_handle< F >::my_func

private

Definition at line 55 of file task_group.h.

Referenced by tbb::task_handle< F >::operator()().

## my_state

template<typename F>

intptr_t tbb::task_handle< F >::my_state

private

Definition at line 56 of file task_group.h.

Referenced by tbb::task_handle< F >::mark_scheduled().

## scheduled

template<typename F>

const intptr_t tbb::task_handle< F >::scheduled = 0x1

static private

Definition at line 53 of file task_group.h.

Referenced by tbb::task_handle< F >::mark_scheduled().

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

- task_group.h

tbb::internal::throw_exception
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
Definition: tbb_exception.h:105
tbb::move
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:319
tbb::task_handle::scheduled
static const intptr_t scheduled
Definition: task_group.h:53
tbb::task_handle::my_func
F my_func
Definition: task_group.h:55
tbb::internal::eid_invalid_multiple_scheduling
Definition: tbb_exception.h:75
tbb::task_handle::my_state
intptr_t my_state
Definition: task_group.h:56

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.