Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Private Attributes | Friends | List of all members
Threads::internal::TaskDescriptor< RT > Struct Template Reference

#include <deal.II/base/thread_management.h>

Inheritance diagram for Threads::internal::TaskDescriptor< RT >:
[legend]

Public Member Functions

 TaskDescriptor (const std::function< RT()> &function)
 
 TaskDescriptor ()
 
 TaskDescriptor (const TaskDescriptor &)=delete
 
 ~TaskDescriptor ()
 
TaskDescriptoroperator= (const TaskDescriptor &)=delete
 
void queue_task ()
 
void join ()
 

Private Attributes

std::function< RT()> function
 
tbb::task * task
 
return_value< RT > ret_val
 
bool task_is_done
 

Friends

template<typename >
struct TaskEntryPoint
 
class ::Threads::Task< RT >
 

Detailed Description

template<typename RT>
struct Threads::internal::TaskDescriptor< RT >

Definition at line 1199 of file thread_management.h.

Constructor & Destructor Documentation

◆ TaskDescriptor() [1/3]

template<typename RT >
Threads::internal::TaskDescriptor< RT >::TaskDescriptor ( const std::function< RT()> &  function)
inline

Constructor. Take the function to be run on this task as argument.

Definition at line 1344 of file thread_management.h.

◆ TaskDescriptor() [2/3]

template<typename RT >
Threads::internal::TaskDescriptor< RT >::TaskDescriptor

Default constructor. Throws an exception since we want to queue a task immediately upon construction of these objects to make sure that each TaskDescriptor object corresponds to exactly one task.

Definition at line 1370 of file thread_management.h.

◆ TaskDescriptor() [3/3]

template<typename RT >
Threads::internal::TaskDescriptor< RT >::TaskDescriptor ( const TaskDescriptor< RT > &  )
delete

Copy constructor. Objects of this type can not be copied, and so this constructor is deleted and can't be called.

◆ ~TaskDescriptor()

template<typename RT >
Threads::internal::TaskDescriptor< RT >::~TaskDescriptor
inline

Destructor.

Definition at line 1379 of file thread_management.h.

Member Function Documentation

◆ operator=()

template<typename RT >
TaskDescriptor& Threads::internal::TaskDescriptor< RT >::operator= ( const TaskDescriptor< RT > &  )
delete

Copy operator. Objects of this type can not be copied, and so this operator is deleted and can't be called.

◆ queue_task()

template<typename RT >
void Threads::internal::TaskDescriptor< RT >::queue_task
inline

Queue up the task to the scheduler. We need to do this in a separate function since the new tasks needs to access objects from the current object and that can only reliably happen if the current object is completely constructed already.

Definition at line 1354 of file thread_management.h.

◆ join()

template<typename RT >
void Threads::internal::TaskDescriptor< RT >::join
inline

Join a task, i.e. wait for it to finish. This function can safely be called from different threads at the same time, and can also be called more than once.

Definition at line 1402 of file thread_management.h.

Friends And Related Function Documentation

◆ TaskEntryPoint

template<typename RT >
template<typename >
friend struct TaskEntryPoint
friend

Definition at line 1337 of file thread_management.h.

◆ ::Threads::Task< RT >

template<typename RT >
friend class ::Threads::Task< RT >
friend

Definition at line 1338 of file thread_management.h.

Member Data Documentation

◆ function

template<typename RT >
std::function<RT()> Threads::internal::TaskDescriptor< RT >::function
private

The function and its arguments that are to be run on the task.

Definition at line 1265 of file thread_management.h.

◆ task

template<typename RT >
tbb::task* Threads::internal::TaskDescriptor< RT >::task
private

Variable holding the data the TBB needs to work with a task. Set by the queue_up_task() function. Note that the object behind this pointer will be deleted upon termination of the task, so we do not have to do so ourselves. In particular, if all objects with pointers to this task_description object go out of scope then no action is needed on our behalf.

Definition at line 1275 of file thread_management.h.

◆ ret_val

template<typename RT >
return_value<RT> Threads::internal::TaskDescriptor< RT >::ret_val
private

A place where the task will deposit its return value.

Definition at line 1280 of file thread_management.h.

◆ task_is_done

template<typename RT >
bool Threads::internal::TaskDescriptor< RT >::task_is_done
private

A flag indicating whether the task has terminated.

Definition at line 1285 of file thread_management.h.


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