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

CTimerEvent Class Reference

#include <CTimerEvent.h>

Inheritance diagram for CTimerEvent:

CEvent CRegisteredObject CNamedObject List of all members.

Public Member Functions

 CTimerEvent (unsigned long nms, bool fRepeat)
 CTimerEvent (const char *pName, unsigned long nms, bool fRepeat)
 CTimerEvent (const STD(string)&rName, unsigned long nms, bool fRepeat)
virtual ~CTimerEvent ()
CTimerMonitorgetMonitor ()
 Allow manipulation of the event monitor:.
CTimerGenericReactorgetReactor ()
 Allow manipulation of the event reactor:.
void Enable (unsigned long nms, bool fRepeat=true)
void Enable ()
void SetTimeout (unsigned long nms)
void Repeat (bool fRepeat=true)
virtual void OnTimer ()
void InternalOnTimer ()
 STD (string) DescribeSelf()

Private Member Functions

 CTimerEvent (const CTimerEvent &rhs)
CTimerEventoperator= (const CTimerEvent &rhs)
int operator== (const CTimerEvent &rhs)

Private Attributes

CTimerMonitorm_rMonitor
 Refer to the timer monitor maintained.
CTimerGenericReactorm_rReactor
 Refers to the callback reactor.

Detailed Description

CTimerEvent encapsulates a thread which manages a single timer event. The timer event is capable of waiting for a fixed period of time. Timer events are either one-shot or are multi-shot. Each timer event can be dynamically switched between one-shot and multi-shot.

Definition at line 319 of file CTimerEvent.h.


Constructor & Destructor Documentation

CTimerEvent::CTimerEvent unsigned long  nms,
bool  fRepeat
 

Construct an anonymous CTimerEvent.

Parameters:
nms - Number of milliseconds before timer expires.
fRepeat - True if the timer is a recurring timer.

Definition at line 341 of file CTimerEvent.cpp.

References getMonitor(), getReactor(), m_rMonitor, m_rReactor, CEvent::setReactivity(), and CTimerMonitor::setTimeout().

CTimerEvent::CTimerEvent const char *  pName,
unsigned long  nms,
bool  fRepeat
 

Construct an named CTimerEvent where the name is given as an char* p C String.

Parameters:
pName - Pointer to object name..
nms - Number of milliseconds before timer expires.
fRepeat - True if the timer is a recurring timer.

Definition at line 358 of file CTimerEvent.cpp.

References m_rMonitor, CEvent::setReactivity(), and CTimerMonitor::setTimeout().

CTimerEvent::CTimerEvent const STD(string)&  rName,
unsigned long  nms,
bool  fRepeat
 

CTimerEvent::~CTimerEvent  )  [virtual]
 

Destroy a timer event. This involves simply deleteing the monitor and the reactor:

Definition at line 391 of file CTimerEvent.cpp.

CTimerEvent::CTimerEvent const CTimerEvent rhs  )  [private]
 


Member Function Documentation

void CTimerEvent::Enable  )  [inline]
 

Enable execution of the event. This is intended to be called from outside the Event thread. This allows us to directly schedule the object as a thread, rather than going through the rigmarole required by CEvent::Schedule

  • Enabling an active thread is a no-op.
  • The enable state is a flag, not a counter, so only a single disable is required to kill the thread regardless of the number of Enable calls.

Reimplemented from CEvent.

Definition at line 371 of file CTimerEvent.h.

References CEvent::Enable().

void CTimerEvent::Enable unsigned long  nms,
bool  fRepeat = true
 

Overload for Enable specific to timers... since one shot timers are allowed, this member is supplied to setup the timer and start it in one operation.

Parameters:
nms - Number of milliseconds before timer expires.
fRepeat- true if this is a repetitive timer.

Definition at line 407 of file CTimerEvent.cpp.

References CEvent::Enable(), m_rMonitor, CTimerMonitor::Repeat(), CEvent::setReactivity(), and CTimerMonitor::setTimeout().

CTimerMonitor& CTimerEvent::getMonitor  )  [inline]
 

Allow manipulation of the event monitor:.

Reimplemented from CEvent.

Definition at line 361 of file CTimerEvent.h.

Referenced by CTimerEvent().

CTimerGenericReactor& CTimerEvent::getReactor  )  [inline]
 

Allow manipulation of the event reactor:.

Reimplemented from CEvent.

Definition at line 364 of file CTimerEvent.h.

Referenced by CTimerEvent().

void CTimerEvent::InternalOnTimer  ) 
 

Called directly from the reactor.

  1. Calls the user overridable member.
  2. If the timer is a single shot timer, the thread is disabled from continuing.

Definition at line 452 of file CTimerEvent.cpp.

References CTimerMonitor::getOneShot(), m_rMonitor, OnTimer(), and CEvent::setEnable().

Referenced by CTimerEvent::CTimerGenericReactor::OnEvent().

void CTimerEvent::OnTimer  )  [virtual]
 

Called internally - user overridable event code. No-OP for now:

Definition at line 467 of file CTimerEvent.cpp.

Referenced by InternalOnTimer().

CTimerEvent& CTimerEvent::operator= const CTimerEvent rhs  )  [private]
 

int CTimerEvent::operator== const CTimerEvent rhs  )  [private]
 

void CTimerEvent::Repeat bool  fRepeat = true  ) 
 

Set the flag indicating if the timer is a repeating or single shot:

Parameters:
fRepeat - True if this is a repetetitve timer.

Definition at line 432 of file CTimerEvent.cpp.

References m_rMonitor, and CTimerMonitor::Repeat().

void CTimerEvent::SetTimeout unsigned long  nms  ) 
 

Re-export the members of the monitor which allow control over the timer. This member sets the timeout.

Parameters:
nms - Number of milliseconds before timeout fires.

Definition at line 421 of file CTimerEvent.cpp.

References m_rMonitor, CEvent::setReactivity(), and CTimerMonitor::setTimeout().

CTimerEvent::STD string   )  [virtual]
 

The name of the object

Reimplemented from CEvent.


Member Data Documentation

CTimerMonitor& CTimerEvent::m_rMonitor [private]
 

Refer to the timer monitor maintained.

Reimplemented from CEvent.

Definition at line 337 of file CTimerEvent.h.

Referenced by CTimerEvent(), Enable(), InternalOnTimer(), Repeat(), and SetTimeout().

CTimerGenericReactor& CTimerEvent::m_rReactor [private]
 

Refers to the callback reactor.

Reimplemented from CEvent.

Definition at line 338 of file CTimerEvent.h.

Referenced by CTimerEvent().


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