Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CTimerMonitor Class Reference

#include <CTimerMonitor.h>

Inheritance diagram for CTimerMonitor:

CEventMonitor CRegisteredObject CNamedObject List of all members.

Public Member Functions

 CTimerMonitor (bool am_fOneShot=true, bool am_fTimedWait=true)
 CTimerMonitor (const string &rName, bool am_fOneShot=true, bool am_fTimedWait=true)
 CTimerMonitor (const char *pName, bool am_fOneShot=true, bool am_fFired=false, bool am_fTimedWait=true)
 ~CTimerMonitor ()
int operator== (const CTimerMonitor &aCTimerMonitor)
bool getOneShot () const
bool getFired () const
virtual CEventMonitor::result operator() ()
void Repeat (bool fRepeat=true)
virtual void setTimeout (int nTimeout=FOREVER)
virtual string DescribeSelf ()

Protected Member Functions

void setOneShot (bool am_fOneShot)
void setFired (bool am_fFired)

Private Member Functions

 CTimerMonitor (const CTimerMonitor &aCTimerMonitor)
 Copy construction is forbidden for now.
CTimerMonitor operator= (const CTimerMonitor &aCTimerMonitor)
 Assignment is forbidden for now.

Private Attributes

bool m_fOneShot
bool m_fFired

Detailed Description

Encapsulates an event monitor for timers. Timers can be either repeating or oneshot. A oneshot timer willl fire once after a delay and then refuse to fire until it's time is reset.

Repeating timers essentially reset their time after each instance of an event.

Definition at line 325 of file CTimerMonitor.h.


Constructor & Destructor Documentation

CTimerMonitor::CTimerMonitor bool  am_fOneShot = true,
bool  am_fTimedWait = true
[inline]
 

Fired flag

Definition at line 334 of file CTimerMonitor.h.

References CNamedObject::AppendClassInfo(), m_fFired, and m_fOneShot.

CTimerMonitor::CTimerMonitor const string &  rName,
bool  am_fOneShot = true,
bool  am_fTimedWait = true
[inline]
 

Definition at line 342 of file CTimerMonitor.h.

References CNamedObject::AppendClassInfo(), m_fFired, and m_fOneShot.

CTimerMonitor::CTimerMonitor const char *  pName,
bool  am_fOneShot = true,
bool  am_fFired = false,
bool  am_fTimedWait = true
[inline]
 

Definition at line 351 of file CTimerMonitor.h.

References CNamedObject::AppendClassInfo(), m_fFired, and m_fOneShot.

CTimerMonitor::~CTimerMonitor  )  [inline]
 

Definition at line 361 of file CTimerMonitor.h.

CTimerMonitor::CTimerMonitor const CTimerMonitor aCTimerMonitor  )  [private]
 

Copy construction is forbidden for now.


Member Function Documentation

string CTimerMonitor::DescribeSelf  )  [virtual]
 

Operation Type: Selector

Purpose: Produces a string describing the object: 1. Calls CEventMonitor::DecribeSelf 2. Dumps the state of the oneshot and timed flags.

Definition at line 405 of file CTimerMonitor.cpp.

bool CTimerMonitor::getFired  )  const [inline]
 

Definition at line 385 of file CTimerMonitor.h.

bool CTimerMonitor::getOneShot  )  const [inline]
 

Definition at line 380 of file CTimerMonitor.h.

Referenced by CTimerEvent::InternalOnTimer().

CEventMonitor::result CTimerMonitor::operator()  )  [virtual]
 

Operation Type: override behavior

Purpose: Waits for the timer as follows: 1. If m_fOneshot is false, this function blocks for m_tvTimeout time, then returns Occured 2. If m_fOneshot is true, but m_fFired is false, blocks for m_tvTimeout, sets m_fFired and returns Occured 3. If m_fOneshot and m_fFired are both true, returns TimedOut

Implements CEventMonitor.

Definition at line 323 of file CTimerMonitor.cpp.

References CEventMonitor::getTimeout(), m_fFired, and NULL.

CTimerMonitor CTimerMonitor::operator= const CTimerMonitor aCTimerMonitor  )  [private]
 

Assignment is forbidden for now.

int CTimerMonitor::operator== const CTimerMonitor aCTimerMonitor  )  [inline]
 

Definition at line 364 of file CTimerMonitor.h.

References m_fFired, m_fOneShot, and CEventMonitor::operator==().

void CTimerMonitor::Repeat bool  fRepeat = true  ) 
 

Operation Type: Mutator

Purpose: Sets m_fOneshot to the value of its parameter.

Definition at line 369 of file CTimerMonitor.cpp.

References m_fFired, and m_fOneShot.

Referenced by CTimerEvent::Enable(), and CTimerEvent::Repeat().

void CTimerMonitor::setFired bool  am_fFired  )  [inline, protected]
 

Definition at line 398 of file CTimerMonitor.h.

References m_fFired.

void CTimerMonitor::setOneShot bool  am_fOneShot  )  [inline, protected]
 

Definition at line 393 of file CTimerMonitor.h.

References m_fOneShot.

void CTimerMonitor::setTimeout int  nTimeout = FOREVER  )  [virtual]
 

Operation Type: Mutator

Purpose: Calls CEventMonitor::setTimeout and clears m_fFired. The wait flag FOREVER results in a MAXINT being passed to CEventMonitor::setTimeout

Reimplemented from CEventMonitor.

Definition at line 387 of file CTimerMonitor.cpp.

References m_fFired, and CEventMonitor::setTimeout().

Referenced by CTimerEvent::CTimerEvent(), CTimerEvent::Enable(), and CTimerEvent::SetTimeout().


Member Data Documentation

bool CTimerMonitor::m_fFired [private]
 

Oneshot flag

Definition at line 328 of file CTimerMonitor.h.

Referenced by CTimerMonitor(), operator()(), operator==(), Repeat(), setFired(), and setTimeout().

bool CTimerMonitor::m_fOneShot [private]
 

Definition at line 327 of file CTimerMonitor.h.

Referenced by CTimerMonitor(), operator==(), Repeat(), and setOneShot().


The documentation for this class was generated from the following files:
Generated on Thu Jan 6 16:58:45 2005 for Spectrodaq External Event Framework by  doxygen 1.3.9.1