E-MailRelay
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GNet::EventHandler Class Reference

A base class for classes that handle asynchronous events from the event loop. More...

#include <geventhandler.h>

+ Inheritance diagram for GNet::EventHandler:

Public Types

enum  Reason {
  reason_closed, reason_down, reason_reset, reason_abort,
  reason_other
}
 

Public Member Functions

virtual ~EventHandler ()
 Destructor.
 
virtual void readEvent ()
 Called for a read event. More...
 
virtual void writeEvent ()
 Called for a write event. More...
 
virtual void otherEvent (Reason)
 Called for a socket-exception event or a socket-close event on windows. More...
 

Static Public Member Functions

static std::string str (Reason)
 Returns a printable description of the other-event reason. More...
 

Detailed Description

A base class for classes that handle asynchronous events from the event loop.

An event handler object has its virtual methods called when an event is detected on the associated file descriptor.

If an event handler throws an exception which is caught by the event loop then the event loop calls the associated ExceptionHandler, if any.

Definition at line 47 of file geventhandler.h.

Member Function Documentation

void GNet::EventHandler::otherEvent ( EventHandler::Reason  reason)
virtual

Called for a socket-exception event or a socket-close event on windows.

Overridable. The default implementation throws an exception.

Reimplemented in GNet::ServerPeer, and GNet::SimpleClient.

Definition at line 40 of file geventhandler.cpp.

void GNet::EventHandler::readEvent ( )
virtual

Called for a read event.

Overridable. The default implementation does nothing.

Reimplemented in GNet::ServerPeer, GNet::SimpleClient, and GNet::Server.

Definition at line 30 of file geventhandler.cpp.

std::string GNet::EventHandler::str ( EventHandler::Reason  reason)
static

Returns a printable description of the other-event reason.

Definition at line 50 of file geventhandler.cpp.

void GNet::EventHandler::writeEvent ( )
virtual

Called for a write event.

Overrideable. The default implementation does nothing.

Reimplemented in GNet::ServerPeer, GNet::SimpleClient, and GNet::Server.

Definition at line 35 of file geventhandler.cpp.


The documentation for this class was generated from the following files: