libassa 3.5.1
|
EventHandler class. More...
#include <EventHandler.h>
Public Member Functions | |
EventHandler () | |
Constructor. | |
virtual | ~EventHandler () |
Virtual destructor. | |
virtual int | handle_read (int fd) |
Read event callback. | |
virtual int | handle_write (int fd) |
Write handler callback. | |
virtual int | handle_except (int fd) |
Exception handler callback. | |
virtual int | handle_timeout (TimerId tid) |
Timeout handler callback. | |
virtual int | handle_signal (int signum_) |
Signal handler callback. | |
virtual int | handle_close (int fd) |
EOF on peer socket handler callback. | |
virtual void | resetState (void) |
A hook for derived class to reset internal state as needed. | |
void | set_id (const std::string &id_) |
Set EventHandler ID. | |
std::string | get_id () const |
Retrieve EventHandler ID. | |
Protected Attributes | |
std::string | m_id |
EventHandler class.
EventHandler is a pure virtual class. It is an interface class to the Event Handlers. These events are processed by Reactor. The supported events are signals, timers, and I/O pipes such as file descriptors, sockets and such.
Definition at line 102 of file EventHandler.h.
|
inline |
Constructor.
Definition at line 164 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
|
inlinevirtual |
|
inline |
Retrieve EventHandler ID.
Definition at line 157 of file EventHandler.h.
References m_id.
Referenced by ASSA::Timer::dump().
EOF on peer socket handler callback.
There is no corresponding EventType. One is not needed because detecting EOF is a part of handle_read () data processing.
Reimplemented in ASSA::Acceptor< SERVICE_HANDLER, PEER_ACCEPTOR >, and ASSA::RemoteLogger.
Definition at line 211 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Exception handler callback.
Definition at line 187 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::Reactor::dispatch().
Read event callback.
If reader detects EOF, it must return error to the Reactor. (See Reactor for details).
Reimplemented in ASSA::Acceptor< SERVICE_HANDLER, PEER_ACCEPTOR >.
Definition at line 171 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::Reactor::dispatch().
Signal handler callback.
Reimplemented in ASSA::ChildStatusHandler, ASSA::GenServer, ASSA::SIGINTHandler, ASSA::SIGUSR1Handler, ASSA::SIGUSR2Handler, ASSA::SIGCHLDHandler, ASSA::SIGALRMHandler, ASSA::SIGPOLLHandler, and ASSA::CFUNC_Handler.
Definition at line 203 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Timeout handler callback.
Reimplemented in ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >.
Definition at line 195 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Write handler callback.
Reimplemented in ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >.
Definition at line 179 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::Reactor::dispatch().
A hook for derived class to reset internal state as needed.
Reimplemented in ASSA::SIGINTHandler, ASSA::SIGUSR1Handler, ASSA::SIGUSR2Handler, ASSA::SIGCHLDHandler, and ASSA::SIGALRMHandler.
Definition at line 219 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Set EventHandler ID.
ID allows Reactor and application-level code describe intelligently the kind of the EventHandler.
Definition at line 153 of file EventHandler.h.
References m_id.
Referenced by ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >::Connector().
|
protected |
Definition at line 160 of file EventHandler.h.