|
libassa
3.5.1
|
EventHandler class. More...
#include <EventHandler.h>
Public Member Functions | |
| EventHandler () | |
| Constructor. More... | |
| virtual | ~EventHandler () |
| Virtual destructor. More... | |
| virtual int | handle_read (int fd) |
| Read event callback. More... | |
| virtual int | handle_write (int fd) |
| Write handler callback. More... | |
| virtual int | handle_except (int fd) |
| Exception handler callback. More... | |
| virtual int | handle_timeout (TimerId tid) |
| Timeout handler callback. More... | |
| virtual int | handle_signal (int signum_) |
| Signal handler callback. More... | |
| virtual int | handle_close (int fd) |
| EOF on peer socket handler callback. More... | |
| virtual void | resetState (void) |
| A hook for derived class to reset internal state as needed. More... | |
| void | set_id (const std::string &id_) |
| Set EventHandler ID. More... | |
| std::string | get_id () const |
| Retrieve EventHandler ID. More... | |
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 165 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::Reactor::dispatchHandler(), ASSA::Timer::dump(), ASSA::Reactor::registerIOHandler(), ASSA::Reactor::removeHandler(), and ASSA::Reactor::removeIOHandler().
|
inlinevirtual |
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 212 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::Reactor::removeHandler(), and ASSA::Reactor::removeIOHandler().
|
inlinevirtual |
Exception handler callback.
Definition at line 188 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::Reactor::dispatch().
|
inlinevirtual |
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 172 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::Reactor::dispatch().
|
inlinevirtual |
Signal handler callback.
Reimplemented in ASSA::SIGPOLLHandler, ASSA::SIGALRMHandler, ASSA::SIGCHLDHandler, ASSA::SIGUSR2Handler, ASSA::GenServer, ASSA::SIGUSR1Handler, ASSA::ChildStatusHandler, ASSA::SIGINTHandler, and ASSA::CFUNC_Handler.
Definition at line 204 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::SigHandler::dispatch(), and ASSA::SigHandlers::dispatch().
|
inlinevirtual |
Timeout handler callback.
Reimplemented in ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >.
Definition at line 196 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::TimerQueue::expire().
|
inlinevirtual |
Write handler callback.
Reimplemented in ASSA::Connector< SERVICE_HANDLER, PEER_CONNECTOR >.
Definition at line 180 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
Referenced by ASSA::Reactor::dispatch().
|
inlinevirtual |
A hook for derived class to reset internal state as needed.
Reimplemented in ASSA::SIGALRMHandler, ASSA::SIGCHLDHandler, ASSA::SIGUSR2Handler, ASSA::SIGUSR1Handler, and ASSA::SIGINTHandler.
Definition at line 220 of file EventHandler.h.
References ASSA::REACTTRACE, and trace_with_mask.
|
inline |
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.
1.8.8