SchedEventHandler::ClientEventHandler< Source, Scheduler > Class Template Reference

#include <scheduler.h>

List of all members.


Detailed Description

template<typename Source, typename Scheduler>
class SchedEventHandler::ClientEventHandler< Source, Scheduler >

Policy class used by Scheduler for events handling.

Parameters:
Source Source class type generating the events
Scheduler Parenting scheduler for this socket type

Definition at line 101 of file scheduler.h.


Static Public Member Functions

static void onEvent (Source *src, SocketEvent evt)
 Socket event handler.
static void handleConnected (Source *src)
 Handles "connection established" type of events.
static void handleWrite (Source *src)
 Handles "socket became writable" type of events.
static void handleRead (Source *src)
 Handles "socket became readable" type of events.
static void handleErr (Source *src, SocketEvent evt)
 Handles all error conditions, e.g.

Private Types

typedef Scheduler::SIter SIter
typedef Scheduler::RIter RIter
typedef Scheduler::UploadReq UploadReq
typedef Scheduler::DownloadReq DownloadReq
typedef Scheduler::ConnReq ConnReq

Member Typedef Documentation

template<typename Source, typename Scheduler>
typedef Scheduler::ConnReq SchedEventHandler::ClientEventHandler< Source, Scheduler >::ConnReq [private]
 

Definition at line 106 of file scheduler.h.

template<typename Source, typename Scheduler>
typedef Scheduler::DownloadReq SchedEventHandler::ClientEventHandler< Source, Scheduler >::DownloadReq [private]
 

Definition at line 105 of file scheduler.h.

template<typename Source, typename Scheduler>
typedef Scheduler::RIter SchedEventHandler::ClientEventHandler< Source, Scheduler >::RIter [private]
 

Definition at line 103 of file scheduler.h.

template<typename Source, typename Scheduler>
typedef Scheduler::SIter SchedEventHandler::ClientEventHandler< Source, Scheduler >::SIter [private]
 

Definition at line 102 of file scheduler.h.

template<typename Source, typename Scheduler>
typedef Scheduler::UploadReq SchedEventHandler::ClientEventHandler< Source, Scheduler >::UploadReq [private]
 

Definition at line 104 of file scheduler.h.


Member Function Documentation

template<typename Source, typename Scheduler>
static void SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleConnected Source *  src  )  [inline, static]
 

Handles "connection established" type of events.

Definition at line 144 of file scheduler.h.

References SchedBase::addUploadReq(), CHECK_FAIL, SchedBase::instance(), EventTableBase::notify(), and SOCK_CONNECTED.

Referenced by SchedEventHandler::ClientEventHandler< Source, Scheduler >::onEvent().

Here is the call graph for this function:

template<typename Source, typename Scheduler>
static void SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleErr Source *  src,
SocketEvent  evt
[inline, static]
 

Handles all error conditions, e.g.

timeouts, connfailed etc.

Parameters:
src Event source
evt The error event

Definition at line 190 of file scheduler.h.

References CHECK_FAIL, SchedBase::delConn(), SchedBase::instance(), Scheduler< Impl, ImplPtr >::invalidateReqs(), and EventTableBase::notify().

Referenced by SchedEventHandler::ClientEventHandler< Source, Scheduler >::onEvent().

Here is the call graph for this function:

template<typename Source, typename Scheduler>
static void SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleRead Source *  src  )  [inline, static]
 

Handles "socket became readable" type of events.

Definition at line 172 of file scheduler.h.

References SchedBase::addDloadReq(), CHECK_FAIL, and SchedBase::instance().

Referenced by SchedEventHandler::ClientEventHandler< Source, Scheduler >::onEvent().

Here is the call graph for this function:

template<typename Source, typename Scheduler>
static void SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleWrite Source *  src  )  [inline, static]
 

Handles "socket became writable" type of events.

Definition at line 155 of file scheduler.h.

References SchedBase::addUploadReq(), CHECK_FAIL, SchedBase::instance(), EventTableBase::notify(), and SOCK_WRITE.

Referenced by SchedEventHandler::ClientEventHandler< Source, Scheduler >::onEvent().

Here is the call graph for this function:

template<typename Source, typename Scheduler>
static void SchedEventHandler::ClientEventHandler< Source, Scheduler >::onEvent Source *  src,
SocketEvent  evt
[inline, static]
 

Socket event handler.

Note that the actual events handling is directed to smaller helper functions for simplicity and clarity.

Parameters:
src Source of the event
evt The event itself
Note:
This function is called from main event loop, and should never be called directly.

Definition at line 118 of file scheduler.h.

References SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleConnected(), SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleErr(), SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleRead(), SchedEventHandler::ClientEventHandler< Source, Scheduler >::handleWrite(), logWarning(), SOCK_CONNECTED, SOCK_CONNFAILED, SOCK_ERR, SOCK_LOST, SOCK_READ, SOCK_TIMEOUT, and SOCK_WRITE.

Here is the call graph for this function:


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