#include <CFileEvent.h>
Inheritance diagram for CFileEvent:
Public Member Functions | |
CFileEvent (int fd, int access=readable) | |
CFileEvent (const char *pName, int flags=O_RDONLY, int access=readable) | |
CFileEvent (const STD(string)&rName, int flags=O_RDONLY, int access=readable) | |
CFileEvent (int fd, const char *pObjName, int access=readable) | |
CFileEvent (const char *pObjName, const char *pName, int flags=O_RDONLY, int access=readable) | |
CFileEvent (const char *pObjName, const STD(string)&rName, int flags=O_RDONLY, int access=readable) | |
CFileEvent (int fd, const STD(string)&rObjName, int access=readable) | |
CFileEvent (const STD(string)&rObjName, const char *pname, int flags=O_RDONLY, int access=readable) | |
CFileEvent (const STD(string)&rObjName, const STD(string)&rName, int flags=O_RDONLY, int access=readable) | |
~CFileEvent () | |
int | getFd () const |
int | getCloseOnDestory () const |
void | MonitorReadable (bool fReadable=true) |
void | MonitorWritable (bool fWritable=true) |
void | MonitorExceptions (bool fExcept=true) |
virtual void | OnReadable (istream &rStream) |
virtual void | OnWritable (ostream &rStream) |
virtual void | OnException (iostream &fd) |
virtual void | OnTimeout (iostream &str) |
virtual | STD (string) DescribeSelf() |
Static Public Attributes | |
int | readable = 1 |
Bitmask for readable monitoring. | |
int | writeable = 2 |
Bitmask for writable monitoring. | |
int | exceptions = 4 |
Bitmask for exception monitoring. | |
Protected Member Functions | |
void | Exit (int status) |
void | SetupMonitor (int AccessMask) |
CFdMonitor * | CreateMonitor (const char *pFilename, const char *pMonitor, int flags) |
Private Member Functions | |
CFileEvent (const CFileEvent &rEvent) | |
CFileEvent & | operator= (const CFileEvent &rhs) |
int | operator== (const CFileEvent &rEvent) |
Private Attributes | |
int | m_nFd |
File descriptor. | |
bool | m_fCloseOnDestroy |
true if we opened the file. |
|
Construct an anonymous file event from a file descriptor, The file monitor is a CFdMonitor directly constructed from the fd via new.
Definition at line 411 of file CFileEvent.cpp. References CNamedObject::AppendClassInfo(), m_fCloseOnDestroy, m_nFd, and SetupMonitor(). |
|
Construct an anonymous file event from a filename as a const char* A file is opened and created with CreateMonitor.
Definition at line 428 of file CFileEvent.cpp. References CNamedObject::AppendClassInfo(), and SetupMonitor(). |
|
|
|
Construct a named file event from a char* object name, and a file descriptor. The CFdMonitor is directly new'd into existence in the operation.
Definition at line 470 of file CFileEvent.cpp. References CNamedObject::AppendClassInfo(), and SetupMonitor(). |
|
Construct a named file event from a char* object name and a char* filename. The CFdMonitor is created by CreateMonitor.
Definition at line 496 of file CFileEvent.cpp. References CNamedObject::AppendClassInfo(), and SetupMonitor(). |
|
|
|
|
|
|
|
|
|
Destructor: In all of the construction methods, the monitor and reactor are dynamically instantiated via new (that's what CreateMonitor will do). We need to get the Monitor and the Reactor and delete them. Definition at line 607 of file CFileEvent.cpp. References CEvent::getMonitor(), CEvent::getReactor(), and m_nFd. |
|
|
|
Creates a new monitor given a filename. The file is created/opened for read/write and the fd resulting is used to create a new CFdMonitor (via new).
Definition at line 735 of file CFileEvent.cpp. References m_nFd. |
|
Exits the thread now (the object must still be destroyed at some point). The global mutex is released unconditionally, a DAQStatus object is created with the given status value and DAQThread::Exit is called.
Definition at line 713 of file CFileEvent.cpp. References CApplicationSerializer::getInstance(), and CThreadRecursiveMutex::UnLockCompletely(). |
|
Definition at line 412 of file CFileEvent.h. |
|
Definition at line 411 of file CFileEvent.h. Referenced by CFileEvent::CFileEventReactor::OnTimeout(). |
|
Select if the monitor should watch exceptions on the fd. This is delegated to the monitor's MonitorExceptions member function.
Definition at line 643 of file CFileEvent.cpp. References CEvent::getMonitor(). Referenced by SetupMonitor(). |
|
Select if the monitor should watch readability. This is delegated to the monitor's MonitorReadable member function.
Definition at line 623 of file CFileEvent.cpp. References CEvent::getMonitor(). Referenced by SetupMonitor(), and CServerInstance::Shutdown(). |
|
Select if the monitor should watch writability. This is delegated to the Monitor's MonitorWritable member function.
Definition at line 633 of file CFileEvent.cpp. References CEvent::getMonitor(). Referenced by SetupMonitor(). |
|
Called when the file descriptor has some exception condition. Normally, if an application is interested in this, the programmer will create a subclass of a CFileEvent which implements this member function in a non null way. Default action is an implemented no-op. This requires the programmer to only provide implementations for the members s/he needs. The alternative (pure virtual member), requires a programmer to implement (even if only as a no-op), all members.
Definition at line 690 of file CFileEvent.cpp. Referenced by CFileEvent::CFileEventReactor::OnException(). |
|
Called when a file descriptor becomes readable. Normally, if an application is interested in this, the programmer will create a subclass of CFileEvent which implements this member function in a non-null way. Default action is an implemented No-op. By implementing (rather than making this a pure virtual member), the programmer needs only to provide the members s/he's interested in.
Reimplemented in CServerInstance. Definition at line 661 of file CFileEvent.cpp. Referenced by CFileEvent::CFileEventReactor::OnReadable(). |
|
Calle dwhen a wait times out, and the caller has idicated that they want to pay attention to timeouts.
Definition at line 699 of file CFileEvent.cpp. Referenced by CFileEvent::CFileEventReactor::OnTimeout(). |
|
Called when the file descriptor becomes writable. Normally, if an application is interested in this, the programmer will create a subclass of a CFileEvent which implements this member function in a non null way. Default action is an implemented no-op. This requires the programmer to only provide implementations for the members s/he needs. The alternative (pure virtual member), requires a programmer to implement (even if only as a no-op), all members.
Definition at line 675 of file CFileEvent.cpp. Referenced by CFileEvent::CFileEventReactor::OnWritable(). |
|
|
|
|
|
Set up the acessibility of the monitor. This means that the access mask is translated into an initial set of calls to MonitorReadable, MonitorWritable.
Definition at line 769 of file CFileEvent.cpp. References MonitorExceptions(), MonitorReadable(), and MonitorWritable(). Referenced by CFileEvent(). |
|
The name of the object Reimplemented from CEvent. Reimplemented in CServerConnectionEvent, and CServerInstance. |
|
Bitmask for exception monitoring.
Definition at line 311 of file CFileEvent.cpp. |
|
true if we opened the file.
Definition at line 365 of file CFileEvent.h. Referenced by CFileEvent(). |
|
File descriptor.
Definition at line 364 of file CFileEvent.h. Referenced by CFileEvent(), CreateMonitor(), and ~CFileEvent(). |
|
Bitmask for readable monitoring.
Definition at line 309 of file CFileEvent.cpp. |
|
Bitmask for writable monitoring.
Definition at line 310 of file CFileEvent.cpp. |