Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CTimer Class Reference

#include <CTimer.h>

List of all members.

Public Methods

 CTimer ()
 Default constructor.

virtual ~CTimer ()
 Destructor.

unsigned int getIntervalms () const
unsigned int getElapsedms () const
TimerListIterator begin ()
TimerListIterator end ()
TimerList getTimerList () const
void Start (unsigned int ms, unsigned int latency=0, bool Reset=false)
void Stop ()
void Reset ()
unsigned int GetElapsedTime ()
void EstablishEvent (CTimedEvent &rEvent)
virtual void OnTimer ()

Private Methods

 CTimer (const CTimer &rhs)
 Copy constructor.

CTimer & operator= (const CTimer &rhs)
 Assignment.

int operator== (const CTimer &rhs) const
 Comparison for equality.

int operator!= (const CTimer &rhs) const

Private Attributes

unsigned int m_nIntervalms
 Timer interval in milliseconds.

unsigned int m_nElapsedms
 Elapsed time since Reset in ms.

unsigned int m_nLatency
 Latency estimate for scheduling.

TimerList m_Events
 STL List containing the managed events.


Constructor & Destructor Documentation

CTimer::CTimer  
 

Default constructor.

Default constructor. This is called when declarations of the form e.g.:

  • CTimer object; are performed.

Definition at line 289 of file CTimer.cpp.

virtual CTimer::~CTimer   [inline, virtual]
 

Destructor.

Definition at line 327 of file CTimer.h.

CTimer::CTimer const CTimer &    rhs [private]
 

Copy constructor.


Member Function Documentation

TimerListIterator CTimer::begin   [inline]
 

Definition at line 346 of file CTimer.h.

References m_Events, and TimerListIterator.

Referenced by OnTimer(), and Reset().

TimerListIterator CTimer::end   [inline]
 

Definition at line 349 of file CTimer.h.

References m_Events, and TimerListIterator.

Referenced by OnTimer(), and Reset().

void CTimer::EstablishEvent CTimedEvent   rEvent
 

Adds an event handler which will be called periodically. A typicall usage might be to schedule periodic scaler readouts when a run is active. Each time a tick fires, it is announced to each timed event. If it is time, the timed event runs itself.

Parameters:
CTimedEvent&  rEvent

Definition at line 388 of file CTimer.cpp.

References m_Events.

Referenced by App::operator()(), MyApp::operator()(), and CExperiment::SetupTimedEvent().

unsigned int CTimer::getElapsedms   const [inline]
 

Definition at line 343 of file CTimer.h.

References m_nElapsedms.

unsigned int CTimer::GetElapsedTime  
 

Returns the number of ms of elapsed active time since the last Reset. Note that this is not the same as the time since the last Reset, as the timer can be stopped and restarted without a reset (in the run control environment, this might represent a pause in the run during which the run elapsed time is frozen but clock time continues to run.

Definition at line 373 of file CTimer.cpp.

References m_nElapsedms.

Referenced by CExperiment::GetElapsedTime().

unsigned int CTimer::getIntervalms   const [inline]
 

Definition at line 339 of file CTimer.h.

References m_nIntervalms.

TimerList CTimer::getTimerList   const [inline]
 

Definition at line 352 of file CTimer.h.

References m_Events, and TimerList.

void CTimer::OnTimer   [virtual]
 

Executes on each timer tick. The set of Timed Events is traversed and told to tick. This causes due events to fire themselves and reset.

Parameters:

Definition at line 402 of file CTimer.cpp.

References begin(), end(), m_nElapsedms, m_nIntervalms, m_nLatency, and TimerListIterator.

int CTimer::operator!= const CTimer &    rhs const [private]
 

CTimer& CTimer::operator= const CTimer &    rhs [private]
 

Assignment.

int CTimer::operator== const CTimer &    rhs const [private]
 

Comparison for equality.

void CTimer::Reset  
 

Resets the elapsed time to zero, and resets all of the timer events in our list.

Definition at line 351 of file CTimer.cpp.

References begin(), end(), m_nElapsedms, and TimerListIterator.

Referenced by Start(), and CExperiment::Start().

void CTimer::Start unsigned int    ms,
unsigned int    latency = 0,
bool    doReset = false
 

Start the timer. By default, the elapsed time is not reset as a result of a start.

Parameters:
ms  - Number of milliseconds between timer firings.
ms  [0] - Estimated scheduling latency in ms.
Reset  [false] - If true, reset elapsed time member to zero.
ms  - Number of milliseconds of granularity in the timer. The timer will call Tick for each event in its list once per ms milliseconds.
doReset=false  - If TRUE, the timed events are all reset prior to starting the clock, and m_nElapsedms is cleared.

Definition at line 316 of file CTimer.cpp.

References m_nIntervalms, m_nLatency, and Reset().

Referenced by App::operator()(), MyApp::operator()(), and CExperiment::Start().

void CTimer::Stop  
 

Stop the timer. The thread is stopped at the next 'tick' dispatch.

Definition at line 339 of file CTimer.cpp.

Referenced by CExperiment::Stop().


Member Data Documentation

TimerList CTimer::m_Events [private]
 

STL List containing the managed events.

Definition at line 320 of file CTimer.h.

Referenced by begin(), end(), EstablishEvent(), and getTimerList().

unsigned int CTimer::m_nElapsedms [private]
 

Elapsed time since Reset in ms.

Definition at line 317 of file CTimer.h.

Referenced by getElapsedms(), GetElapsedTime(), OnTimer(), and Reset().

unsigned int CTimer::m_nIntervalms [private]
 

Timer interval in milliseconds.

Definition at line 316 of file CTimer.h.

Referenced by getIntervalms(), OnTimer(), and Start().

unsigned int CTimer::m_nLatency [private]
 

Latency estimate for scheduling.

Definition at line 318 of file CTimer.h.

Referenced by OnTimer(), and Start().


The documentation for this class was generated from the following files:
Generated on Fri Nov 8 13:37:27 2002 for Event Readout system. by doxygen1.2.16