mbo::MboIntervalThread Class Reference

An interval thread implementation. More...

#include <MboThread.h>

Inheritance diagram for mbo::MboIntervalThread:

Inheritance graph
{mbo::MboThread\n|# m_hThread\l# m_hIsStopping\l# m_dwThreadId\l# m_mxStartStop\l- m_szThreadName\l|+ MboThread()\l+ MboThread()\l+ ~MboThread()\l+ IsRunning()\l+ IsStopping()\l+ WaitFor()\l+ KillThread()\l+ GetThreadId()\l+ SetThreadPriority()\l+ GetThreadName()\l+ Action()\l+ OnActionException()\l+ Start()\l+ Stop()\l+ OnThreadStart()\l+ OnThreadStop()\l+ SetThreadName()\l# ThreadProc()\l- ThreadProcCaller()\l- ThreadNamer()\l- ThreadProcRunner()\l- ForceThreadName()\l- operator=()\l}
[legend]
Collaboration diagram for mbo::MboIntervalThread:

Collaboration graph
{mbo::MboThread\n|# m_hThread\l# m_hIsStopping\l# m_dwThreadId\l# m_mxStartStop\l- m_szThreadName\l|+ MboThread()\l+ MboThread()\l+ ~MboThread()\l+ IsRunning()\l+ IsStopping()\l+ WaitFor()\l+ KillThread()\l+ GetThreadId()\l+ SetThreadPriority()\l+ GetThreadName()\l+ Action()\l+ OnActionException()\l+ Start()\l+ Stop()\l+ OnThreadStart()\l+ OnThreadStop()\l+ SetThreadName()\l# ThreadProc()\l- ThreadProcCaller()\l- ThreadNamer()\l- ThreadProcRunner()\l- ForceThreadName()\l- operator=()\l}{mbo::CCriticalSectionImpl\n|- m_cs\l|+ CCriticalSectionImpl()\l+ ~CCriticalSectionImpl()\l+ Enter()\l+ Leave()\l+ GetLock()\l+ GetLevel()\l}{mbo::ICriticalSection\n||+ ~ICriticalSection()\l+ Enter()\l+ Leave()\l+ GetLock()\l+ GetLevel()\l}
[legend]

List of all members.

Public Member Functions

 MboIntervalThread (size_t nMilliSeconds=1000, const char *szThreadName=NULL)
virtual ~MboIntervalThread ()
IncDecVal GetCounter () const

Protected Member Functions

virtual void SetInterval (size_t nMilliSeconds=1000)
virtual size_t GetInterval () const


Detailed Description

An interval thread implementation.

The derived class MboIntervalThread implements an endless loop that sleeps for a given amount of time between each calls of Action(). The callbacks OnThreadStart()/OnThreadStop() are only called once.

Note:
This class is distributed under the following license GNU Lesser General Public License, version 2.1.

Definition at line 324 of file MboThread.h.


Constructor & Destructor Documentation

mbo::MboIntervalThread::MboIntervalThread ( size_t  nMilliSeconds = 1000,
const char *  szThreadName = NULL 
) [explicit]

constructor

Parameters:
nMilliSeconds interval between two thread cycles
szThreadName The name of the thread. The new class instance will copy the value and free its copy automatically upon destruction. You may want to use NULL to use the class name of as the thread name. If you do so the name is computed in thread startup - this only works if this is not done in constructor. If done so the name you will see is the name of that parent class whose constructor started the thread.
Note:
You can see thread names only in MSVC.NET and above or MSVC.6-SP2.

virtual mbo::MboIntervalThread::~MboIntervalThread (  )  [virtual]

destructor


Member Function Documentation

IncDecVal mbo::MboIntervalThread::GetCounter (  )  const

Counts the execution times of Action()

Returns:
number of times Action() was invoked

virtual void mbo::MboIntervalThread::SetInterval ( size_t  nMilliSeconds = 1000  )  [protected, virtual]

Set sleep time between two calls of Action()

Parameters:
nMilliSeconds time in milli seconds

virtual size_t mbo::MboIntervalThread::GetInterval (  )  const [protected, virtual]

Get sleep time between two calls of Action()

Returns:
time in milli seconds


The documentation for this class was generated from the following file:
  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:13 2008 for MBO-lib by doxygen 1.5.4