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

CBufferEvent< T > Class Template Reference

#include <CBufferEvent.h>

Inheritance diagram for CBufferEvent< T >:

CEvent CRegisteredObject CNamedObject List of all members.

Public Member Functions

 CBufferEvent ()
 Anonymous buffer event.
 CBufferEvent (const char *pName)
 Named event with char* name.
 CBufferEvent (const STD(string)&rName)
 Named event with STD(string) name.
 ~CBufferEvent ()
 Destroy the event.
 STD (list)< AddLinkRequest > getPendingAddQueue() const
 STD (list)< AddLinkRequest > getPendingDeleteQueue() const
CBufferMonitor< T > & getMonitor ()
 Allow manipulation of the event monitor:.
CBufferReactor< T > & getReactor ()
 Allow manipulation of the event reactor:.
void AddLink (const STD(string)&url, unsigned int tag, unsigned int mask=ALLBITS_MASK, int reliability=COS_RELIABLE)
void DeleteLink (const STD(string)&url, unsigned int tag, unsigned int mask=ALLBITS_MASK, int reliability=COS_RELIABLE)
virtual void OnBuffer (Pointer< DAQBuffer< T >, T > &pBuffer)
virtual void OnTimeout ()
virtual void setBufferTag (int tag)
virtual void setBufferMask (int mask)
virtual STD (string) DescribeSelf()

Protected Member Functions

virtual void ProcessQueues ()
void ProcessAddQueue ()
void ProcessDelQueue ()
 STD (string) QueueEntryToString(AddLinkRequest &rEntry)

Private Member Functions

 STD (list)< AddLinkRequest > m_AddQueue
 Requests to add links go here.
 STD (list)< AddLinkRequest > m_DelQueue
 Requests to delete links go here.
 CBufferEvent (const CBufferEvent &rhs)
CBufferEventoperator= (const CBufferEvent &rhs)
int operator== (const CBufferEvent &rhs)

Private Attributes

CBufferMonitor< T > & m_rMonitor
 Monitors the input links.
CGenericBufferReactor< T > & m_rReactor
 Reacts to the input links.

template<class T>
class CBufferEvent< T >


Constructor & Destructor Documentation

template<class T>
CBufferEvent< T >::CBufferEvent  ) 
 

Anonymous buffer event.

Construct an anonymous event. The monitor is a standard buffer monitor, the event readctor is a CGenericBufferReactor.

Definition at line 366 of file CBufferEvent.cpp.

References CBufferEvent< T >::getMonitor(), CBufferEvent< T >::getReactor(), CBufferEvent< T >::m_rMonitor, and CBufferEvent< T >::m_rReactor.

template<class T>
CBufferEvent< T >::CBufferEvent const char *  pName  ) 
 

Named event with char* name.

Called to create a named buffer event when the name is a char* string:

Definition at line 378 of file CBufferEvent.cpp.

template<class T>
CBufferEvent< T >::CBufferEvent const STD(string)&  rName  ) 
 

Named event with STD(string) name.

template<class T>
CBufferEvent< T >::~CBufferEvent  ) 
 

Destroy the event.

Destroy the buffer event:

Definition at line 402 of file CBufferEvent.cpp.

template<class T>
CBufferEvent< T >::CBufferEvent const CBufferEvent< T > &  rhs  )  [private]
 


Member Function Documentation

template<class T>
void CBufferEvent< T >::AddLink const STD(string)&  url,
unsigned int  tag,
unsigned int  mask = ALLBITS_MASK,
int  reliability = COS_RELIABLE
 

template<class T>
void CBufferEvent< T >::DeleteLink const STD(string)&  url,
unsigned int  tag,
unsigned int  mask = ALLBITS_MASK,
int  reliability = COS_RELIABLE
 

template<class T>
CBufferMonitor<T>& CBufferEvent< T >::getMonitor  )  [inline]
 

Allow manipulation of the event monitor:.

Reimplemented from CEvent.

Definition at line 420 of file CBufferEvent.h.

Referenced by CBufferEvent< T >::CBufferEvent().

template<class T>
CBufferReactor<T>& CBufferEvent< T >::getReactor  )  [inline]
 

Allow manipulation of the event reactor:.

Reimplemented from CEvent.

Definition at line 423 of file CBufferEvent.h.

Referenced by CBufferEvent< T >::CBufferEvent().

template<class T>
void CBufferEvent< T >::OnBuffer Pointer< DAQBuffer< T >, T > &  pBuffer  )  [virtual]
 

This member function is the default (no-op) action when a buffer has been received on the link.

Parameters:
pBuffer - A `pointer' into the DAQBuffer<T>

Definition at line 484 of file CBufferEvent.cpp.

Referenced by CBufferEvent< T >::CGenericBufferReactor< U >::OnBuffer().

template<class T>
void CBufferEvent< T >::OnTimeout  )  [virtual]
 

This member function is the default (no-op) action when waiting for buffers has timed out and timeout delivery is enabled.

Definition at line 494 of file CBufferEvent.cpp.

Referenced by CBufferEvent< T >::CGenericBufferReactor< U >::OnTimeout().

template<class T>
CBufferEvent& CBufferEvent< T >::operator= const CBufferEvent< T > &  rhs  )  [private]
 

template<class T>
int CBufferEvent< T >::operator== const CBufferEvent< T > &  rhs  )  [private]
 

template<class T>
void CBufferEvent< T >::ProcessAddQueue  )  [protected]
 

This utility function is called to take all of the elements in the Add queue and create links corresponding to them. It should be called only in the context of the executing event thread.

Definition at line 522 of file CBufferEvent.cpp.

References CApplicationSerializer::getInstance(), CThreadRecursiveMutex::Lock(), CBufferEvent< T >::m_rMonitor, CBufferEvent< T >::AddLinkRequest::s_linktype, CBufferEvent< T >::AddLinkRequest::s_mask, CBufferEvent< T >::AddLinkRequest::s_tag, and CThreadRecursiveMutex::UnLock().

Referenced by CBufferEvent< T >::ProcessQueues().

template<class T>
void CBufferEvent< T >::ProcessDelQueue  )  [protected]
 

This utility function is called periodically in the context of the event thread. It dequeues each element from the delete link request queue and deletes the corresponding link.

Definition at line 542 of file CBufferEvent.cpp.

References CApplicationSerializer::getInstance(), LinkIterator, CThreadRecursiveMutex::Lock(), CBufferEvent< T >::m_rMonitor, CBufferEvent< T >::AddLinkRequest::s_mask, CBufferEvent< T >::AddLinkRequest::s_tag, and CThreadRecursiveMutex::UnLock().

Referenced by CBufferEvent< T >::ProcessQueues().

template<class T>
void CBufferEvent< T >::ProcessQueues  )  [protected, virtual]
 

Called periodically at event thread context to process any ITC's (inter thread communication) primitives which are required by the event. In this case, we need to process the two link request queues:

  • m_AddQueue - queue of links to add.
  • m_DelQueue - queue of links to delete.

since context switches are in theory unpredictable, it's possible to queue a deletion on an add request which has not yet been processed. Therefore, the add queue is processed first and then the delete queue.

Reimplemented from CEvent.

Definition at line 510 of file CBufferEvent.cpp.

References CBufferEvent< T >::ProcessAddQueue(), and CBufferEvent< T >::ProcessDelQueue().

template<class T>
virtual void CBufferEvent< T >::setBufferMask int  mask  )  [inline, virtual]
 

Definition at line 442 of file CBufferEvent.h.

template<class T>
virtual void CBufferEvent< T >::setBufferTag int  tag  )  [inline, virtual]
 

Definition at line 439 of file CBufferEvent.h.

template<class T>
CBufferEvent< T >::STD string   )  [protected, virtual]
 

The name of the object

Reimplemented from CEvent.

template<class T>
virtual CBufferEvent< T >::STD string   )  [virtual]
 

The name of the object

Reimplemented from CEvent.

template<class T>
CBufferEvent< T >::STD list   )  const [inline]
 

Definition at line 414 of file CBufferEvent.h.

template<class T>
CBufferEvent< T >::STD list   )  const [inline]
 

Definition at line 408 of file CBufferEvent.h.

template<class T>
CBufferEvent< T >::STD list   )  [private]
 

Requests to delete links go here.

template<class T>
CBufferEvent< T >::STD list   )  [private]
 

Requests to add links go here.

Referenced by CBufferEvent< U >::STD().


Member Data Documentation

template<class T>
CBufferMonitor<T>& CBufferEvent< T >::m_rMonitor [private]
 

Monitors the input links.

Reimplemented from CEvent.

Definition at line 386 of file CBufferEvent.h.

Referenced by CBufferEvent< T >::CBufferEvent(), CBufferEvent< T >::ProcessAddQueue(), and CBufferEvent< T >::ProcessDelQueue().

template<class T>
CGenericBufferReactor<T>& CBufferEvent< T >::m_rReactor [private]
 

Reacts to the input links.

Reimplemented from CEvent.

Definition at line 387 of file CBufferEvent.h.

Referenced by CBufferEvent< T >::CBufferEvent().


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