Array of thread parameters. More...
#include <cmtkThreadParameterArray.h>
Public Member Functions | |
ThreadParameterArray (TClass *const thisObject, const size_t numberOfThreads) | |
Constructor. | |
~ThreadParameterArray () | |
Destructor. | |
const TParam & | operator[] (const size_t i) const |
Constant access operator. | |
TParam & | operator[] (const size_t i) |
Access operator. | |
TParam * | GetPtr () |
Return pointer to array. | |
const TParam * | GetPtr () const |
Return constant pointer to array. | |
size_t | GetNumberOfThreads () const |
Return number of threads. | |
void | RunInParallel (ThreadFunction threadCall) |
Run thread function in parallel. | |
void | RunInParallelAsynchronous (ThreadFunction threadCall) |
Run thread function in parallel without joining. | |
void | JoinAsynchronousThreads () |
Collect (join) threads previously started by RunInParallelAsynchronous. | |
void | CancelAsynchronousThreads () |
Cancel (terminate) threads previously started by RunInParallelAsynchronous. | |
bool | IsRunning (const size_t idx) |
Check if a given thread is running. | |
void | RunInParallelFIFO (ThreadFunction threadCall, const size_t numberOfThreadsTotal, const size_t firstThreadIdx=0) |
Run thread functions using a static FIFO scheduler. | |
Private Attributes | |
size_t | m_NumberOfThreads |
Store number of threads and entries in parameter array. | |
TParam * | m_Ptr |
Pointer to parameter block array. | |
bool | m_AsynchronousThreadsRunning |
Flag for running asynchronous threads. |
Array of thread parameters.
This array initializes the non-template type specific fields of the thread parameter structure.
Definition at line 53 of file cmtkThreadParameterArray.h.
cmtk::ThreadParameterArray< TClass, TParam >::ThreadParameterArray | ( | TClass *const | thisObject, |
const size_t | numberOfThreads | ||
) | [inline] |
Constructor.
Allocate array and initialize generic fields.
Definition at line 60 of file cmtkThreadParameterArray.h.
cmtk::ThreadParameterArray< TClass, TParam >::~ThreadParameterArray | ( | ) | [inline] |
Destructor.
Definition at line 75 of file cmtkThreadParameterArray.h.
References cmtk::Memory::DeleteArray().
size_t cmtk::ThreadParameterArray< TClass, TParam >::GetNumberOfThreads | ( | ) | const [inline] |
Return number of threads.
Definition at line 95 of file cmtkThreadParameterArray.h.
TParam* cmtk::ThreadParameterArray< TClass, TParam >::GetPtr | ( | ) | [inline] |
Return pointer to array.
Definition at line 89 of file cmtkThreadParameterArray.h.
const TParam* cmtk::ThreadParameterArray< TClass, TParam >::GetPtr | ( | ) | const [inline] |
Return constant pointer to array.
Definition at line 92 of file cmtkThreadParameterArray.h.
bool cmtk::ThreadParameterArray< TClass, TParam >::IsRunning | ( | const size_t | idx ) | [inline] |
Check if a given thread is running.
Definition at line 113 of file cmtkThreadParameterArray.h.
TParam& cmtk::ThreadParameterArray< TClass, TParam >::operator[] | ( | const size_t | i ) | [inline] |
Access operator.
Definition at line 86 of file cmtkThreadParameterArray.h.
const TParam& cmtk::ThreadParameterArray< TClass, TParam >::operator[] | ( | const size_t | i ) | const [inline] |
Constant access operator.
Definition at line 83 of file cmtkThreadParameterArray.h.
void cmtk::ThreadParameterArray< TClass, TParam >::RunInParallel | ( | ThreadFunction | threadCall ) | [inline] |
Run thread function in parallel.
Definition at line 98 of file cmtkThreadParameterArray.h.
References cmtk::Threads::GetNumberOfThreads(), and cmtk::Threads::RunThreads().
Referenced by cmtk::SplineWarpCongealingFunctional::EvaluateWithGradient().
bool cmtk::ThreadParameterArray< TClass, TParam >::m_AsynchronousThreadsRunning [private] |
Flag for running asynchronous threads.
Definition at line 129 of file cmtkThreadParameterArray.h.
size_t cmtk::ThreadParameterArray< TClass, TParam >::m_NumberOfThreads [private] |
Store number of threads and entries in parameter array.
Definition at line 123 of file cmtkThreadParameterArray.h.
TParam* cmtk::ThreadParameterArray< TClass, TParam >::m_Ptr [private] |
Pointer to parameter block array.
Definition at line 126 of file cmtkThreadParameterArray.h.