OpenWalnut  1.3.1
Public Types | Public Member Functions | Protected Attributes | List of all members
WThreadedStripingJobs< Input_T, Job_T > Class Template Referenceabstract

Nearly the same class as WThreadedJobs, but this class is intended to be used for multithreaded operations on voxels and therefore it uses Striping to partition the data. More...

#include <WThreadedJobs.h>

Public Types

typedef Input_T InputType
 the input type More...
 
typedef Job_T JobType
 the job type More...
 

Public Member Functions

 WThreadedStripingJobs (boost::shared_ptr< InputType const > input)
 Constructor. More...
 
virtual ~WThreadedStripingJobs ()
 Destructor. More...
 
void operator() (std::size_t id, std::size_t numThreads, WBoolFlag const &shutdown)
 The threaded function operation. More...
 
virtual void compute (boost::shared_ptr< InputType const > input, std::size_t voxelNum)=0
 Abstract function that performs the actual computation per voxel. More...
 

Protected Attributes

boost::shared_ptr< InputType
const > 
m_input
 the input More...
 

Detailed Description

template<class Input_T, class Job_T>
class WThreadedStripingJobs< Input_T, Job_T >

Nearly the same class as WThreadedJobs, but this class is intended to be used for multithreaded operations on voxels and therefore it uses Striping to partition the data.

This is necessarry since if the threads are not operating on blocks, they slow down!

Definition at line 135 of file WThreadedJobs.h.

Member Typedef Documentation

template<class Input_T, class Job_T>
typedef Input_T WThreadedStripingJobs< Input_T, Job_T >::InputType

the input type

Definition at line 139 of file WThreadedJobs.h.

template<class Input_T, class Job_T>
typedef Job_T WThreadedStripingJobs< Input_T, Job_T >::JobType

the job type

Definition at line 142 of file WThreadedJobs.h.

Constructor & Destructor Documentation

template<class Input_T , class Job_T >
WThreadedStripingJobs< Input_T, Job_T >::WThreadedStripingJobs ( boost::shared_ptr< InputType const >  input)

Constructor.

Parameters
inputThe input.

Definition at line 181 of file WThreadedJobs.h.

References WThreadedStripingJobs< Input_T, Job_T >::m_input.

template<class Input_T , class Job_T >
WThreadedStripingJobs< Input_T, Job_T >::~WThreadedStripingJobs ( )
virtual

Destructor.

Definition at line 191 of file WThreadedJobs.h.

Member Function Documentation

template<class Input_T, class Job_T>
virtual void WThreadedStripingJobs< Input_T, Job_T >::compute ( boost::shared_ptr< InputType const >  input,
std::size_t  voxelNum 
)
pure virtual

Abstract function that performs the actual computation per voxel.

Parameters
inputThe input data.
voxelNumThe voxel number to operate on.

Implemented in WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >.

template<class Input_T , class Job_T >
void WThreadedStripingJobs< Input_T, Job_T >::operator() ( std::size_t  id,
std::size_t  numThreads,
WBoolFlag const &  shutdown 
)

The threaded function operation.

Pulls jobs and executes the

See Also
compute() function.
Parameters
idThe thread's ID.
numThreadsHow many threads are working on the jobs.
shutdownA shared flag indicating the thread should be stopped.

Definition at line 196 of file WThreadedJobs.h.

Member Data Documentation

template<class Input_T, class Job_T>
boost::shared_ptr< InputType const > WThreadedStripingJobs< Input_T, Job_T >::m_input
protected

the input

Definition at line 176 of file WThreadedJobs.h.

Referenced by WThreadedStripingJobs< Input_T, Job_T >::WThreadedStripingJobs().


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