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

CEventMonitor Class Reference

#include <CEventMonitor.h>

Inheritance diagram for CEventMonitor:

CRegisteredObject CNamedObject CBufferMonitor< T > CFdMonitor CLocationMonitor< T > CTimerMonitor CServerMonitor List of all members.

Public Types

enum  result { Occurred = 0, TimedOut = 1, Error = 2 }

Public Member Functions

 CEventMonitor (bool am_fTimedWait=true)
 CEventMonitor (const STD(string)&rName, bool am_fTimedWait=true)
 CEventMonitor (const char *pName, bool am_fTimedWait=true)
int operator== (const CEventMonitor &aCEventMonitor) const
virtual ~CEventMonitor ()
timeval getTimeout () const
bool getTimedWait () const
virtual CEventMonitor::result operator() ()=0
virtual void setTimeout (int nTimeout=FOREVER)

Protected Member Functions

void setTimeout (const timeval am_tvTimeout)
void setTimedWait (const bool am_fTimedWait)

Static Protected Member Functions

 STD (string) GetAutoName(const STD(string)&rBaseName)

Private Member Functions

 CEventMonitor (const CEventMonitor &aCEventMonitor)
 Copy construction is forbidden for now.
CEventMonitor operator= (const CRegisteredObject &aCEventMonitor)
 Assignment is forbidden for now.

Private Attributes

timeval m_tvTimeout
bool m_fTimedWait

Static Private Attributes

unsigned int m_nAutoIndex

Detailed Description

This file defines the CEventMonitor class. CEventMonitor is the ABC for all Event Monitors. An event monitor provides event specific logic for waiting for external program events. operator() is expected to wait for an event to occur and return to indicate if the event in fact did occur.

Definition at line 328 of file CEventMonitor.h.


Member Enumeration Documentation

enum CEventMonitor::result
 

Used to name autonamed objects

Enumeration values:
Occurred 
TimedOut 
Error 

Definition at line 337 of file CEventMonitor.h.


Constructor & Destructor Documentation

CEventMonitor::CEventMonitor bool  am_fTimedWait = true  ) 
 

Default constructor. An EventMonitor with name of the form Monitor_nnn is created. The monitor is entered in to the "Monitors" registry of the classified object registry returned from getCClassifiedObjectRegistry(). The name used is gaurenteed unique and can be queried via: getName().

Definition at line 317 of file CEventMonitor.cpp.

References CNamedObject::AppendClassInfo(), m_fTimedWait, m_tvTimeout, and RegistryName.

CEventMonitor::CEventMonitor const STD(string)&  rName,
bool  am_fTimedWait = true
 

CEventMonitor::CEventMonitor const char *  pName,
bool  am_fTimedWait = true
 

Constructs an event monitor given its name as an ASCII string and an (optional) value for m_fTimedWait :

Parameters:
pName - char* pointer to the desired object name.
am_fTimedWait - bool indicates whether the monitor is timed
Throws: -CDuplicateNameException (indirectly) if an event monitor of this name already exists.

Definition at line 359 of file CEventMonitor.cpp.

References CNamedObject::AppendClassInfo(), m_fTimedWait, m_tvTimeout, and RegistryName.

CEventMonitor::CEventMonitor const CEventMonitor aCEventMonitor  )  [private]
 

Copy construction is forbidden for now.

CEventMonitor::~CEventMonitor  )  [virtual]
 

Destructor: Just ensure that we are removed from the Reactors registry before being destroyed.

Definition at line 373 of file CEventMonitor.cpp.

References CRegisteredObject::getRegistry(), RegistryName, and CClassifiedObjectRegistry::Remove().


Member Function Documentation

bool CEventMonitor::getTimedWait  )  const [inline]
 

Definition at line 377 of file CEventMonitor.h.

Referenced by CFdMonitor::operator()(), and CBufferMonitor< T >::operator()().

timeval CEventMonitor::getTimeout  )  const [inline]
 

Definition at line 372 of file CEventMonitor.h.

Referenced by CTimerMonitor::operator()(), CLocationMonitor< T >::operator()(), CFdMonitor::operator()(), and CBufferMonitor< T >::operator()().

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

Implemented in CBufferMonitor< T >, CFdMonitor, CLocationMonitor< T >, CServerMonitor, CTimerMonitor, and CBufferMonitor< U >.

CEventMonitor CEventMonitor::operator= const CRegisteredObject aCEventMonitor  )  [private]
 

Assignment is forbidden for now.

Reimplemented from CRegisteredObject.

Reimplemented in CFdMonitor.

int CEventMonitor::operator== const CEventMonitor aCEventMonitor  )  const [inline]
 

Definition at line 350 of file CEventMonitor.h.

References m_fTimedWait, m_tvTimeout, and CRegisteredObject::operator==().

Referenced by CTimerMonitor::operator==(), CLocationMonitor< T >::operator==(), and CFdMonitor::operator==().

void CEventMonitor::setTimedWait const bool  am_fTimedWait  )  [inline, protected]
 

Definition at line 390 of file CEventMonitor.h.

References m_fTimedWait.

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

void CEventMonitor::setTimeout(int nTimeout=FOREVER) Operation Type: mutator

Purpose: Sets the timeout. The length of the timeout is determined by the parameter in ms.. Special values: 0 - Poll (return instantly). FOREVER - Block until event.

Reimplemented in CTimerMonitor.

Definition at line 394 of file CEventMonitor.cpp.

References m_fTimedWait, and m_tvTimeout.

void CEventMonitor::setTimeout const timeval  am_tvTimeout  )  [inline, protected]
 

Definition at line 385 of file CEventMonitor.h.

References m_tvTimeout.

Referenced by CEvent::operator()(), and CTimerMonitor::setTimeout().

CEventMonitor::STD string   )  const [static, protected]
 

Reimplemented from CNamedObject.


Member Data Documentation

bool CEventMonitor::m_fTimedWait [private]
 

Timeout length

Definition at line 331 of file CEventMonitor.h.

Referenced by CEventMonitor(), operator==(), setTimedWait(), and setTimeout().

unsigned int CEventMonitor::m_nAutoIndex [static, private]
 

Timed wait?

Reimplemented from CNamedObject.

timeval CEventMonitor::m_tvTimeout [private]
 

Definition at line 330 of file CEventMonitor.h.

Referenced by CEventMonitor(), operator==(), and setTimeout().


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