Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkThreadWorker Class Reference

#include <mitkThreadMasterWorker.h>

Inherits mitkObject.

Inheritance diagram for mitkThreadWorker:

Inheritance graph
[legend]
Collaboration diagram for mitkThreadWorker:

Collaboration graph
[legend]
List of all members.

Protected Member Functions

virtual int TasksPerTime ()
virtual void SendTaskBag (void *taskBag)
virtual void DoTask (int taskID, int taskNumber)=0
virtual mitkThreadWorkerDuplicate ()=0

Friends

class mitkThreadMaster

Detailed Description

mitkThreadWorker - encapsulates a worker of the Master/Worker model. A worker can be driven by a thread of the master to fulfil the scheduled tasks.

mitkThreadWorker encapsules a worker of the Master/Worker model. A worker can be driven by a thread of the master to fulfil the scheduled tasks. The class can be subclassed as a specific implementation of some parallel part of an algorithm.


Member Function Documentation

virtual void mitkThreadWorker::DoTask int  taskID,
int  taskNumber
[protected, pure virtual]
 

Do the scheduled task, called automatically by master

Parameters:
taskID Sent by master indicating the task (or the first of the tasks) that should be done.
taskNumber Sent by master indicating how many tasks actually should be done. It is no less than 1 and no more than the return value of TasksPerTime

virtual mitkThreadWorker* mitkThreadWorker::Duplicate  )  [protected, pure virtual]
 

Should be implemented. Used by master to duplicate workers from a single "sample worker".

virtual void mitkThreadWorker::SendTaskBag void *  taskBag  )  [inline, protected, virtual]
 

Called by the master when a group of tasks are sent to be done

Parameters:
taskBag Information of the group of tasks

virtual int mitkThreadWorker::TasksPerTime  )  [inline, protected, virtual]
 

Overwrite this function when more than one task will be done in do task function. The master use this function to decide the progress.

Returns:
Return the number of tasks done in each call to DoTask


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:06:39 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3