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

CTimedEvent Class Reference

#include <CTimedEvent.h>

Inheritance diagram for CTimedEvent:

CamacTestThread CamacTestThread CPing CRunVariableDumpTrigger CScalerTrigger VMETestThread List of all members.

Public Methods

 CTimedEvent (unsigned int nms=1000)
 Default constructor.

 CTimedEvent (const CTimedEvent &rhs)
 Copy constructor.

virtual ~CTimedEvent ()
 Destructor.

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

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

int operator!= (const CTimedEvent &rhs) const
unsigned int getMsInterval () const
unsigned int getCountDown () const
void Tick (unsigned int nms)
void SetInterval (unsigned int nms)
void Reset ()
virtual void operator() ()=0

Protected Methods

void setCountdown (unsigned int nmsleft)

Private Attributes

unsigned int m_nMsInterval
 Number of milliseconds between events.

int m_nCountDown
 Number of milliseconds until next event fire.


Detailed Description

Abstract base class representing timed events. Example of a timed event in the Readout context is the trigger for scaler readouts.

Timed events are to be inserted in a CTimer which will periodically call the Tick member function so that the event can schedule itself at the resolution of the timer.

Definition at line 290 of file CTimedEvent.h.


Constructor & Destructor Documentation

CTimedEvent::CTimedEvent unsigned int    nms = 1000
 

Default constructor.

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

  • CTimedEvent object(nms);
are performed.
Parameters:
nms  = 1000 - Number of milliseconds between invocations of this event when the associated CTimer is active.

Definition at line 292 of file CTimedEvent.cpp.

CTimedEvent::CTimedEvent const CTimedEvent &    rhs
 

Copy constructor.

Copy construction. This is invoked when e.g. an object is passed by value to a function. The copy constructor makes a clone of the rhs object.

Definition at line 301 of file CTimedEvent.cpp.

virtual CTimedEvent::~CTimedEvent   [inline, virtual]
 

Destructor.

Definition at line 301 of file CTimedEvent.h.


Member Function Documentation

unsigned int CTimedEvent::getCountDown   const [inline]
 

Definition at line 316 of file CTimedEvent.h.

References m_nCountDown.

unsigned int CTimedEvent::getMsInterval   const [inline]
 

Definition at line 312 of file CTimedEvent.h.

References m_nMsInterval.

int CTimedEvent::operator!= const CTimedEvent &    rhs const [inline]
 

Definition at line 305 of file CTimedEvent.h.

References operator==().

virtual void CTimedEvent::operator()   [pure virtual]
 

Invoked when the timer expires. The user of this class must subclass and override this to supply application specific functionality.

Implemented in CRunVariableDumpTrigger, CScalerTrigger, CamacTestThread, CamacTestThread, VMETestThread, and CPing.

Referenced by Tick().

CTimedEvent & CTimedEvent::operator= const CTimedEvent &    aCTimedEvent
 

Assignment.

Assignment operation. This member function supports assignment of an object of this class to an object of the same class.

Definition at line 312 of file CTimedEvent.cpp.

References m_nCountDown, and m_nMsInterval.

int CTimedEvent::operator== const CTimedEvent &    rhs const
 

Comparison for equality.

Equality copmarison:

Definition at line 326 of file CTimedEvent.cpp.

References m_nCountDown, and m_nMsInterval.

Referenced by operator!=().

void CTimedEvent::Reset  
 

Resets the countdown.

Parameters:

Definition at line 375 of file CTimedEvent.cpp.

References m_nCountDown, and m_nMsInterval.

Referenced by SetInterval().

void CTimedEvent::setCountdown unsigned int    nmsleft [inline, protected]
 

Definition at line 322 of file CTimedEvent.h.

References m_nCountDown.

void CTimedEvent::SetInterval unsigned int    nms
 

The interval is set to a new value.. This implies a reset.

Parameters:
unsigned  int nms

Definition at line 361 of file CTimedEvent.cpp.

References m_nMsInterval, and Reset().

Referenced by CExperiment::Start().

void CTimedEvent::Tick unsigned int    nms
 

Execute a clock tick. The m_nCountDown is decremented. If <= 0, operator() is called and the countdown is reset.

Parameters:
nms  - Number of milliseconds in the tick.
unsigned  int nms
Note:
If the interval is not an even multiple of the tick period, the event timing will be correct on the average only.

Definition at line 344 of file CTimedEvent.cpp.

References m_nCountDown, m_nMsInterval, and operator()().


Member Data Documentation

int CTimedEvent::m_nCountDown [private]
 

Number of milliseconds until next event fire.

Definition at line 294 of file CTimedEvent.h.

Referenced by getCountDown(), operator=(), operator==(), Reset(), setCountdown(), and Tick().

unsigned int CTimedEvent::m_nMsInterval [private]
 

Number of milliseconds between events.

Definition at line 293 of file CTimedEvent.h.

Referenced by getMsInterval(), operator=(), operator==(), Reset(), SetInterval(), and Tick().


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