12#ifndef _EventHandler_h
13#define _EventHandler_h
A collection of assert function wrappers.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
A wrapper class to provide AutoPtr with reference semantics.
virtual int handle_close(int fd)
EOF on peer socket handler callback.
virtual int handle_signal(int signum_)
Signal handler callback.
virtual int handle_write(int fd)
Write handler callback.
virtual int handle_except(int fd)
Exception handler callback.
void set_id(const std::string &id_)
Set EventHandler ID.
virtual void resetState(void)
A hook for derived class to reset internal state as needed.
std::string get_id() const
Retrieve EventHandler ID.
virtual int handle_timeout(TimerId tid)
Timeout handler callback.
virtual ~EventHandler()
Virtual destructor.
EventHandler()
Constructor.
virtual int handle_read(int fd)
Read event callback.
EventType
EventType defines events types that Reactor understands.
@ WRITE_EVENT
Notify when there will be room for at least 1 byte to be written to IO channel without blocking.
@ ALL_EVENTS
Mask that includes all events.
@ SIGNAL_EVENT
Notify when UNIX signal is delivered by OS.
@ READ_EVENT
Notify when there will be at least 1 byte available for reading from IO channel without blocking .
@ RWE_EVENTS
READ_EVENT | WRITE_EVENT | EXCEPT_EVENT
@ EXCEPT_EVENT
Notify when there is an exception condition detected in TCP layer.
@ TIMEOUT_EVENT
Notify about expired timer.
unsigned long TimerId
Timer Id is used in handle_timeout() calls.
bool isReadEvent(EventType e_)
bool isExceptEvent(EventType e_)
@ REACTTRACE
Extended Reactor/PrioriyQueue messages
bool isSignalEvent(EventType e_)
bool isTimeoutEvent(EventType e_)
int(EventHandler::* EH_IO_Callback)(int)
A type for the pointer to I/O-related callback member function of class EventHandler.
bool isRWEEvents(EventType e_)
bool isAllEvents(EventType e_)
bool isWriteEvent(EventType e_)