Public Member Functions | Static Public Member Functions | Private Attributes

Threads::Task< RT > Class Template Reference
[Parallel computing with multiple processors accessing shared memory]

List of all members.

Public Member Functions

 Task (const std_cxx1x::function< RT()> &function_object)
 Task ()
void join () const
RT return_value ()
bool operator== (const Task &t)

Static Public Member Functions

::ExceptionBaseExcNoTask ()

Private Attributes

std_cxx1x::shared_ptr
< internal::TaskDescriptor< RT > > 
task_descriptor

Detailed Description

template<typename RT = void>
class Threads::Task< RT >

Describes one task object based on the Threading Building Blocks' Task. Note that the call to join() must be executed on the same thread as the call to the constructor. Otherwise, there might be a deadlock. In other words, a Task object should never passed on to another task for calling the join() method.

Author:
Wolfgang Bangerth, 2009

Definition at line 4089 of file thread_management.h.


Constructor & Destructor Documentation

template<typename RT = void>
Threads::Task< RT >::Task ( const std_cxx1x::function< RT()> &  function_object ) [inline]

Construct a task object given a function object to execute on the task.

Definition at line 4097 of file thread_management.h.

References Threads::Task< RT >::task_descriptor.

template<typename RT = void>
Threads::Task< RT >::Task (  ) [inline]

Default constructor. You can't do much with a task object constructed this way, except for assigning it a task object that holds data created by the spawn functions.

Definition at line 4117 of file thread_management.h.


Member Function Documentation

template<typename RT = void>
void Threads::Task< RT >::join (  ) const [inline]

Join the task represented by this object, i.e. wait for it to finish. You can't call this function if you have used the default constructor of this class and have not assigned a task object to it.

Definition at line 4129 of file thread_management.h.

References AssertThrow, Threads::Task< RT >::ExcNoTask(), and Threads::Task< RT >::task_descriptor.

Referenced by Threads::Task< RT >::return_value().

template<typename RT = void>
RT Threads::Task< RT >::return_value (  ) [inline]

Get the return value of the function of the task. Since this is only available once the task finishes, this implicitly also calls join().

Definition at line 4145 of file thread_management.h.

References Threads::Task< RT >::join(), and Threads::Task< RT >::task_descriptor.

template<typename RT = void>
bool Threads::Task< RT >::operator== ( const Task< RT > &  t ) [inline]

Check for equality of task objects. Since objects of this class store an implicit pointer to an object that exists exactly once for each task, the check is simply to compare these pointers.

Definition at line 4161 of file thread_management.h.

References AssertThrow, Threads::Task< RT >::ExcNoTask(), and Threads::Task< RT >::task_descriptor.


Member Data Documentation

template<typename RT = void>
std_cxx1x::shared_ptr<internal::TaskDescriptor<RT> > Threads::Task< RT >::task_descriptor [private]

Shared pointer to the object representing the task. Boost's shared pointer implementation will make sure that that object lives as long as there is at least one subscriber to it.

Definition at line 4186 of file thread_management.h.

Referenced by Threads::Task< RT >::join(), Threads::Task< RT >::operator==(), Threads::Task< RT >::return_value(), and Threads::Task< RT >::Task().


The documentation for this class 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