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

CFileEvent::CFileEventReactor Class Reference

Inheritance diagram for CFileEvent::CFileEventReactor:

CFdReactor CReactor CRegisteredObject CNamedObject List of all members.

Public Member Functions

 CFileEventReactor (const STD(string)&rName, CFileEvent &rOwner)
 ~CFileEventReactor ()
virtual void OnReadable (CFdMonitor &rMonitor, int fd)
virtual void OnWritable (CFdMonitor &rMonitor, int fd)
virtual void OnException (CFdMonitor &rMonitor, int fd)
virtual void OnTimeout (CEventMonitor &rMonitor)

Private Attributes

CFileEventm_rOwner
 Owner of us.

Detailed Description

Nested class which provides reactor for file events which pushes control back into the event object. The intent is to provide a monolithic look and feel to the CFileEvent class while retaining the flexibility of monitors and reactors. This simplifies the programming model to the average physicist by hiding the complexity introduced by these beasts.

Definition at line 349 of file CFileEvent.h.


Constructor & Destructor Documentation

CFileEvent::CFileEventReactor::CFileEventReactor const STD(string)&  rName,
CFileEvent rOwner
 

CFileEvent::CFileEventReactor::~CFileEventReactor  )  [inline]
 

Definition at line 354 of file CFileEvent.h.


Member Function Documentation

void CFileEvent::CFileEventReactor::OnException CFdMonitor rMonitor,
int  fd
[virtual]
 

Called when an exceptional condition is encountered on a file. We create an iostream and bounce the call back to m_rOwner's OnException. This creates the look and feel of a monolithic Event class.

Reimplemented from CFdReactor.

Definition at line 378 of file CFileEvent.cpp.

References m_rOwner, and CFileEvent::OnException().

void CFileEvent::CFileEventReactor::OnReadable CFdMonitor rMonitor,
int  fd
[virtual]
 

Called whenever the file becomes readable. We create an istream for the file, and call back to m_rOwner's OnReadable member. This all makes the Event seem like a monolithic unit to the user.... They just subclass it, open a file in an appropriate way and poof.

Parameters:
rMonitor - Refers to the monitor on the file (unused).
fd - File descriptor open on the file.

Reimplemented from CFdReactor.

Definition at line 349 of file CFileEvent.cpp.

References m_rOwner, and CFileEvent::OnReadable().

void CFileEvent::CFileEventReactor::OnTimeout CEventMonitor rMonitor  )  [virtual]
 

Called when a wait on the file event times out.

Parameters:
rMonitor -referens to the event monitor.

Reimplemented from CReactor.

Definition at line 390 of file CFileEvent.cpp.

References CFileEvent::getFd(), m_rOwner, and CFileEvent::OnTimeout().

void CFileEvent::CFileEventReactor::OnWritable CFdMonitor rMonitor,
int  fd
[virtual]
 

Called when a file descriptor becomes writable. We just create a stream and bounce the call back to the CFileEvent's OnWritable member. This presents a monolithic look and feel to the end user of this library.

Parameters:
rMonitor - The file monitor which declared the event.(unused)
fd - The file id which is now writable (constructs the ostream)

Reimplemented from CFdReactor.

Definition at line 367 of file CFileEvent.cpp.

References m_rOwner, and CFileEvent::OnWritable().


Member Data Documentation

CFileEvent& CFileEvent::CFileEventReactor::m_rOwner [private]
 

Owner of us.

Definition at line 351 of file CFileEvent.h.

Referenced by OnException(), OnReadable(), OnTimeout(), and OnWritable().


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