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

CLocationMonitor< T > Class Template Reference

#include <CLocationMonitor.h>

Inheritance diagram for CLocationMonitor< T >:

CEventMonitor CRegisteredObject CNamedObject List of all members.

Public Member Functions

 CLocationMonitor (volatile T *am_pTLocation, CPointerPredicate< T > *am_Predicate, bool am_fTimedWait=true)
 CLocationMonitor (const string &rName, volatile T *am_pTLocation, CPointerPredicate< T > *am_Predicate, bool am_fTimedWait=true)
 CLocationMonitor (const char *pName, volatile T *am_pTLocation, CPointerPredicate< T > *am_Predicate, bool am_fTimedWait=true)
 ~CLocationMonitor ()
int operator== (const CLocationMonitor< T > &aCLocationMonitor) const
volatile T * getLocation () const
CPointerPredicate< T > getPredicate () const
virtual CEventMonitor::result operator() ()
void ChangeLocation (T *pNewLocation)
void ChangePredicate (CPointerPredicate< T > *newloc)
getContents () const
virtual string DescribeSelf ()

Protected Member Functions

void setLocation (volatile T *am_pTLocation)
void setPredicate (CPointerPredicate< T > &am_Predicate)

Private Member Functions

 CLocationMonitor (const CLocationMonitor< T > &aCLocationMonitor)
CLocationMonitor< T > operator= (const CLocationMonitor< T > &aCLocationMonitor)

Private Attributes

volatile T * m_pTLocation
CPointerPredicate< T > * m_Predicate

Detailed Description

template<typename T>
class CLocationMonitor< T >

Encapsulates a location monitor. The location monitor watches a volatile memory location to satisfy some predicate function object. Predicates are objects from classes which implement: bool operator()(T value) T is a templated variable of the class. Such objects are function objects. The Event is fired when the predicate returns TRUE.

Definition at line 335 of file CLocationMonitor.h.


Constructor & Destructor Documentation

template<typename T>
CLocationMonitor< T >::CLocationMonitor volatile T *  am_pTLocation,
CPointerPredicate< T > *  am_Predicate,
bool  am_fTimedWait = true
[inline]
 

associated predicate

template<typename T>
CLocationMonitor< T >::CLocationMonitor const string &  rName,
volatile T *  am_pTLocation,
CPointerPredicate< T > *  am_Predicate,
bool  am_fTimedWait = true
[inline]
 

template<typename T>
CLocationMonitor< T >::CLocationMonitor const char *  pName,
volatile T *  am_pTLocation,
CPointerPredicate< T > *  am_Predicate,
bool  am_fTimedWait = true
[inline]
 

template<typename T>
CLocationMonitor< T >::~CLocationMonitor  )  [inline]
 

template<typename T>
CLocationMonitor< T >::CLocationMonitor const CLocationMonitor< T > &  aCLocationMonitor  )  [private]
 


Member Function Documentation

template<typename T>
void CLocationMonitor< T >::ChangeLocation T *  pNewLocation  ) 
 

Operation Type: Mutator

Purpose: Changes the location monitored.

Definition at line 360 of file CLocationMonitor.cpp.

References CLocationMonitor< T >::m_pTLocation.

template<typename T>
void CLocationMonitor< T >::ChangePredicate CPointerPredicate< T > *  newLoc  ) 
 

Operation Type: Mutator

Purpose: Associates a new predicate with the location monitor.

Definition at line 377 of file CLocationMonitor.cpp.

References CLocationMonitor< T >::m_Predicate.

template<typename T>
string CLocationMonitor< T >::DescribeSelf  )  [virtual]
 

Operation Type: Selector

Purpose: Returns a string which describes the monitor. Inlcudes: 1. CEventMonitor::DescribeSelf 2. Dumps of the pointer value, 3. m_Predicate->DescribeSelf()

Definition at line 396 of file CLocationMonitor.cpp.

References CLocationMonitor< T >::m_Predicate, and CLocationMonitor< T >::m_pTLocation.

template<typename T>
T CLocationMonitor< T >::getContents  )  const [inline]
 

Definition at line 419 of file CLocationMonitor.h.

template<typename T>
volatile T* CLocationMonitor< T >::getLocation  )  const [inline]
 

Definition at line 390 of file CLocationMonitor.h.

Referenced by CLocationReactor< T >::OnEvent().

template<typename T>
CPointerPredicate<T> CLocationMonitor< T >::getPredicate  )  const [inline]
 

Definition at line 395 of file CLocationMonitor.h.

template<typename T>
CEventMonitor::result CLocationMonitor< T >::operator()  )  [virtual]
 

Operation Type: Override behavior

Purpose: Reads the current value of the location and passes it to the predicate. Returns: 1. Occured - if the predicate returned TRUE 2. TimedOut - if the wait time for this event timedout. 3. Error - If the predicate threw an exception.

Implements CEventMonitor.

Definition at line 321 of file CLocationMonitor.cpp.

References CEventMonitor::getTimeout(), CLocationMonitor< T >::m_Predicate, and NULL.

template<typename T>
CLocationMonitor<T> CLocationMonitor< T >::operator= const CLocationMonitor< T > &  aCLocationMonitor  )  [private]
 

template<typename T>
int CLocationMonitor< T >::operator== const CLocationMonitor< T > &  aCLocationMonitor  )  const [inline]
 

Definition at line 371 of file CLocationMonitor.h.

References CLocationMonitor< T >::m_Predicate, CLocationMonitor< T >::m_pTLocation, and CEventMonitor::operator==().

template<typename T>
void CLocationMonitor< T >::setLocation volatile T *  am_pTLocation  )  [inline, protected]
 

Definition at line 403 of file CLocationMonitor.h.

References CLocationMonitor< T >::m_pTLocation.

template<typename T>
void CLocationMonitor< T >::setPredicate CPointerPredicate< T > &  am_Predicate  )  [inline, protected]
 

Definition at line 408 of file CLocationMonitor.h.

References CLocationMonitor< T >::m_Predicate.


Member Data Documentation

template<typename T>
CPointerPredicate<T>* CLocationMonitor< T >::m_Predicate [private]
 

Location monitored

Definition at line 338 of file CLocationMonitor.h.

Referenced by CLocationMonitor< T >::ChangePredicate(), CLocationMonitor< T >::DescribeSelf(), CLocationMonitor< T >::operator()(), CLocationMonitor< T >::operator==(), and CLocationMonitor< T >::setPredicate().

template<typename T>
volatile T* CLocationMonitor< T >::m_pTLocation [private]
 

Definition at line 337 of file CLocationMonitor.h.

Referenced by CLocationMonitor< T >::ChangeLocation(), CLocationMonitor< T >::DescribeSelf(), CLocationMonitor< T >::operator==(), and CLocationMonitor< T >::setLocation().


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