mbo::MboDelayedEventThread Class Reference

An event driven thread implementation. More...

#include <MboThread.h>

Inheritance diagram for mbo::MboDelayedEventThread:

Inheritance graph
{mbo::MboEventThread\n|- m_nCounter\l- m_hEvent\l|+ MboEventThread()\l+ ~MboEventThread()\l+ GetCounter()\l+ SetEvent()\l+ IsSignaled()\l+ Stop()\l- ThreadProc()\l}{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::MboDelayedEventThread:

Collaboration graph
{mbo::MboEventThread\n|- m_nCounter\l- m_hEvent\l|+ MboEventThread()\l+ ~MboEventThread()\l+ GetCounter()\l+ SetEvent()\l+ IsSignaled()\l+ Stop()\l- ThreadProc()\l}{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

 MboDelayedEventThread (size_t nMilliSeconds=0, bool bAutoStart=true, const char *szThreadName=NULL)
virtual ~MboDelayedEventThread ()
virtual void Stop ()
virtual void SetDelay (size_t nMilliSeconds=0)
virtual size_t GetDelay () const


Detailed Description

An event driven thread implementation.

The derived class MboEventThread implements an endless loop that waits for an event to occur (SetEvent) between each calls of Action(). The callbacks OnThreadStart()/OnThreadStop() are only called once. Unlike the base class MboEventThread you can set a delay between event and action.

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

Definition at line 463 of file MboThread.h.


Constructor & Destructor Documentation

mbo::MboDelayedEventThread::MboDelayedEventThread ( size_t  nMilliSeconds = 0,
bool  bAutoStart = true,
const char *  szThreadName = NULL 
) [explicit]

constructor

Parameters:
nMilliSeconds delay between event and action.
bAutoStart whether to automatically start the event thread.
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::MboDelayedEventThread::~MboDelayedEventThread (  )  [virtual]

destructor


Member Function Documentation

virtual void mbo::MboDelayedEventThread::Stop (  )  [virtual]

Stop the thread.

This stops the thread by signaling it and skipping the delay. Neither Action() is called nor will the Action() counter be incremented.

Reimplemented from mbo::MboEventThread.

virtual void mbo::MboDelayedEventThread::SetDelay ( size_t  nMilliSeconds = 0  )  [virtual]

Set delay between event and call to Action()

Parameters:
nMilliSeconds time in milli seconds

virtual size_t mbo::MboDelayedEventThread::GetDelay (  )  const [virtual]

Get delay between event and call to 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