#include <CTimer.h>
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. |
|
Default constructor. Default constructor. This is called when declarations of the form e.g.:
Definition at line 289 of file CTimer.cpp. |
|
Destructor.
|
|
Copy constructor.
|
|
Definition at line 346 of file CTimer.h. References m_Events, and TimerListIterator. |
|
Definition at line 349 of file CTimer.h. References m_Events, and TimerListIterator. |
|
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.
Definition at line 388 of file CTimer.cpp. References m_Events. Referenced by App::operator()(), MyApp::operator()(), and CExperiment::SetupTimedEvent(). |
|
Definition at line 343 of file CTimer.h. References m_nElapsedms. |
|
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(). |
|
Definition at line 339 of file CTimer.h. References m_nIntervalms. |
|
|
|
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.
Definition at line 402 of file CTimer.cpp. References begin(), end(), m_nElapsedms, m_nIntervalms, m_nLatency, and TimerListIterator. |
|
|
|
Assignment.
|
|
Comparison for equality.
|
|
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(). |
|
Start the timer. By default, the elapsed time is not reset as a result of a start.
Definition at line 316 of file CTimer.cpp. References m_nIntervalms, m_nLatency, and Reset(). Referenced by App::operator()(), MyApp::operator()(), and CExperiment::Start(). |
|
Stop the timer. The thread is stopped at the next 'tick' dispatch. Definition at line 339 of file CTimer.cpp. Referenced by CExperiment::Stop(). |
|
STL List containing the managed events.
Definition at line 320 of file CTimer.h. Referenced by begin(), end(), EstablishEvent(), and getTimerList(). |
|
Elapsed time since Reset in ms.
Definition at line 317 of file CTimer.h. Referenced by getElapsedms(), GetElapsedTime(), OnTimer(), and Reset(). |
|
Timer interval in milliseconds.
Definition at line 316 of file CTimer.h. Referenced by getIntervalms(), OnTimer(), and Start(). |
|
Latency estimate for scheduling.
|