GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Public Member Functions | Protected Attributes | List of all members
gpu_coverage::AbstractTask Class Referenceabstract

Abstract superclass for parallel tasks. More...

#include <AbstractTask.h>

Inheritance diagram for gpu_coverage::AbstractTask:
Inheritance graph
[legend]

Public Member Functions

 AbstractTask (SharedData *const sharedData, const size_t threadNr)
 Constructor. More...
 
virtual ~AbstractTask ()
 Destructor.
 
virtual void run ()=0
 Method doing the main work of the task.
 
virtual void finish ()
 Method called after all parallel tasks have finished their run() method.
 
bool isReady () const
 
void setSeed (unsigned int seed)
 

Protected Attributes

const size_t threadNr
 Thread number.
 
bool ready
 Set to true when renderer is ready, see isReady().
 
SharedData *const sharedData
 Task synchronization objects.
 
unsigned int seed
 Random seed.
 

Detailed Description

Abstract superclass for parallel tasks.

This class is the abstract superclass for tasks can can be executed in parallel.

Subclasses must implement at least the following methods:

Constructor & Destructor Documentation

gpu_coverage::AbstractTask::AbstractTask ( SharedData *const  sharedData,
const size_t  threadNr 
)

Constructor.

Parameters
[in]sharedDataTask synchronization objects shared between all tasks.
[in]threadNrThe number of the thread executing the task.

Subclasses should set ready = true when the task is initialized and ready to be executed.

Member Function Documentation

bool gpu_coverage::AbstractTask::isReady ( ) const
inline

Returns true if the task is ready to be executed.

Returns
True if task is ready.
void gpu_coverage::AbstractTask::setSeed ( unsigned int  seed)
inline

Set random seed for reproducible results.

Parameters
[in]seedRandom seed.

By default, a seed based on time and thread number is used.


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