Public Member Functions | Private Attributes

cmtk::ThreadParameterArray< TClass, TParam > Class Template Reference
[cmtkSystem Library]

Array of thread parameters. More...

#include <cmtkThreadParameterArray.h>

List of all members.

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.

Detailed Description

template<class TClass, class TParam = ThreadParameters<TClass>>
class cmtk::ThreadParameterArray< TClass, TParam >

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.


Constructor & Destructor Documentation

template<class TClass, class TParam = ThreadParameters<TClass>>
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.

template<class TClass, class TParam = ThreadParameters<TClass>>
cmtk::ThreadParameterArray< TClass, TParam >::~ThreadParameterArray (  ) [inline]

Destructor.

Definition at line 75 of file cmtkThreadParameterArray.h.

References cmtk::Memory::DeleteArray().


Member Function Documentation

template<class TClass, class TParam = ThreadParameters<TClass>>
size_t cmtk::ThreadParameterArray< TClass, TParam >::GetNumberOfThreads (  ) const [inline]

Return number of threads.

Definition at line 95 of file cmtkThreadParameterArray.h.

template<class TClass, class TParam = ThreadParameters<TClass>>
TParam* cmtk::ThreadParameterArray< TClass, TParam >::GetPtr (  ) [inline]

Return pointer to array.

Definition at line 89 of file cmtkThreadParameterArray.h.

template<class TClass, class TParam = ThreadParameters<TClass>>
const TParam* cmtk::ThreadParameterArray< TClass, TParam >::GetPtr (  ) const [inline]

Return constant pointer to array.

Definition at line 92 of file cmtkThreadParameterArray.h.

template<class TClass, class TParam = ThreadParameters<TClass>>
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.

template<class TClass, class TParam = ThreadParameters<TClass>>
TParam& cmtk::ThreadParameterArray< TClass, TParam >::operator[] ( const size_t  i ) [inline]

Access operator.

Definition at line 86 of file cmtkThreadParameterArray.h.

template<class TClass, class TParam = ThreadParameters<TClass>>
const TParam& cmtk::ThreadParameterArray< TClass, TParam >::operator[] ( const size_t  i ) const [inline]

Constant access operator.

Definition at line 83 of file cmtkThreadParameterArray.h.

template<class TClass, class TParam = ThreadParameters<TClass>>
void cmtk::ThreadParameterArray< TClass, TParam >::RunInParallel ( ThreadFunction  threadCall ) [inline]

Member Data Documentation

template<class TClass, class TParam = ThreadParameters<TClass>>
bool cmtk::ThreadParameterArray< TClass, TParam >::m_AsynchronousThreadsRunning [private]

Flag for running asynchronous threads.

Definition at line 129 of file cmtkThreadParameterArray.h.

template<class TClass, class TParam = ThreadParameters<TClass>>
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.

template<class TClass, class TParam = ThreadParameters<TClass>>
TParam* cmtk::ThreadParameterArray< TClass, TParam >::m_Ptr [private]

Pointer to parameter block array.

Definition at line 126 of file cmtkThreadParameterArray.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines