Public Member Functions | Private Attributes | Friends

Threads::internal::TaskDescriptor< RT > Struct Template Reference

List of all members.

Public Member Functions

 TaskDescriptor (const std_cxx1x::function< RT()> &function)
 TaskDescriptor ()
 TaskDescriptor (const TaskDescriptor &)
 ~TaskDescriptor ()
void queue_task ()
void join ()

Private Attributes

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

Friends

struct TaskEntryPoint
struct Task

Detailed Description

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

Definition at line 3813 of file thread_management.h.


Constructor & Destructor Documentation

template<typename RT >
Threads::internal::TaskDescriptor< RT >::TaskDescriptor ( const std_cxx1x::function< RT()> &  function ) [inline]

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

Definition at line 3920 of file thread_management.h.

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 3947 of file thread_management.h.

References Assert, and StandardExceptions::ExcInternalError().

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

Copy constructor. Throws an exception since we want to make sure that each TaskDescriptor object corresponds to exactly one task.

Definition at line 3955 of file thread_management.h.

References Assert, and StandardExceptions::ExcInternalError().

template<typename RT >
Threads::internal::TaskDescriptor< RT >::~TaskDescriptor (  ) [inline]

Destructor.

Definition at line 3964 of file thread_management.h.

References Assert, and StandardExceptions::ExcInternalError().


Member Function Documentation

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 3930 of file thread_management.h.

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 3997 of file thread_management.h.


Friends And Related Function Documentation

template<typename RT>
friend struct TaskEntryPoint [friend]

Definition at line 3912 of file thread_management.h.

template<typename RT>
friend struct Task [friend]

Definition at line 3913 of file thread_management.h.


Member Data Documentation

template<typename RT>
std_cxx1x::function<RT ()> Threads::internal::TaskDescriptor< RT >::function [private]

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

Definition at line 3820 of file thread_management.h.

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 3835 of file thread_management.h.

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 3841 of file thread_management.h.

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

A flag indicating whether the task has terminated.

Definition at line 3847 of file thread_management.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:17 by doxygen 1.7.2