OpenWalnut  1.5.0dev
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>

+ Inheritance diagram for WThreadedStripingJobs< Input_T, Job_T >:
+ Collaboration diagram for WThreadedStripingJobs< Input_T, Job_T >:

Public Types

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

Public Member Functions

 WThreadedStripingJobs (std::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 (std::shared_ptr< InputType const > input, std::size_t voxelNum)=0
 Abstract function that performs the actual computation per voxel. More...
 

Protected Attributes

std::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 133 of file WThreadedJobs.h.

Member Typedef Documentation

◆ InputType

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

the input type

Definition at line 137 of file WThreadedJobs.h.

◆ JobType

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

the job type

Definition at line 140 of file WThreadedJobs.h.

Constructor & Destructor Documentation

◆ WThreadedStripingJobs()

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

Constructor.

Parameters
inputThe input.

Definition at line 179 of file WThreadedJobs.h.

References WThreadedStripingJobs< Input_T, Job_T >::m_input.

◆ ~WThreadedStripingJobs()

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

Destructor.

Definition at line 189 of file WThreadedJobs.h.

Member Function Documentation

◆ compute()

template<class Input_T , class Job_T >
virtual void WThreadedStripingJobs< Input_T, Job_T >::compute ( std::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 >.

◆ operator()()

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 194 of file WThreadedJobs.h.

Member Data Documentation

◆ m_input

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

the input

Definition at line 174 of file WThreadedJobs.h.

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


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