xmsinterp  1.0
xms::ThreadLoop Class Referenceabstract

Thread worker class. More...

#include <ThreadLoop.h>

Inheritance diagram for xms::ThreadLoop:
xms::InterpIdwImpl::InterpThread xms::NodalFuncImpl::NfThread

Classes

class  impl
 Implementation of ThreadLoop. More...
 

Public Member Functions

void SetStartNumIterCnt (int a_startIdx, int a_numIter, int *a_cntPtr)
 Sets up the thread worker. More...
 
void DoWork ()
 Executes the work of the thread.
 
virtual BSHP< ThreadLoopCreateForNewThread ()=0
 Overridden by derived class. More...
 

Protected Member Functions

int CurrIdx ()
 Returns the current index of the thread. More...
 

Private Member Functions

virtual void Worker ()=0
 Overridden by derived class.
 
 XM_DISALLOW_COPY_AND_ASSIGN (ThreadLoop)
 prevent compiler generated copy/assign
 

Private Attributes

BSHP< implm_p
 implementation class
 

Detailed Description

Thread worker class.

Class representing a boost thread.

See also
ThreadLoop::impl

Definition at line 23 of file ThreadLoop.h.

Member Function Documentation

◆ CreateForNewThread()

virtual BSHP<ThreadLoop> xms::ThreadLoop::CreateForNewThread ( )
pure virtual

Overridden by derived class.

Returns
shared pointer to ThreadLoop

Implemented in xms::InterpIdwImpl::InterpThread, and xms::NodalFuncImpl::NfThread.

◆ CurrIdx()

int xms::ThreadLoop::CurrIdx ( )
protected

Returns the current index of the thread.

Returns
Current index.

Definition at line 89 of file ThreadLoop.cpp.

References m_p.

Referenced by xms::InterpIdwImpl::InterpThread::Worker(), and xms::NodalFuncImpl::NfThread::Worker().

◆ SetStartNumIterCnt()

void xms::ThreadLoop::SetStartNumIterCnt ( int  a_startIdx,
int  a_numIter,
int *  a_cntPtr 
)

Sets up the thread worker.

Parameters
[in]a_startIdxThe starting index for this thread
[in]a_numIterThe number of iterations for the thread to execute
[out]a_cntPtrPointer to a counter that is updated by each iteration of this thread.

Definition at line 79 of file ThreadLoop.cpp.

References m_p.


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