EpollScheduler Class Reference

Scheduler implementation using level triggered epoll. More...

#include <epollscheduler.h>

Inheritance diagram for EpollScheduler:

BaseScheduler Microthread NewCoroutine Coroutine RefCounter List of all members.

Public Member Functions

void addReadCallback (Callback &cb, int fd)
 Tells this Scheduler to run cb when fd is readable.
void addWriteCallback (Callback &cb, int fd)
 Tells this Scheduler to run cb when fd is writeable.
void addWaitCallback (Callback &cb, const timeval &tv)
 Tells this Scheduler to run cb when tv is reached.
void run ()
 This method is run when the Microthread gets started.

Static Public Member Functions

static EpollSchedulercreate (BlockingQueue< Microthread * > *q=NULL)
 Named constructor for EpollScheduler.

Protected Member Functions

 EpollScheduler (BlockingQueue< Microthread * > *q=NULL)
 Constructs a EpollScheduler running on queue q.

Detailed Description

Scheduler implementation using level triggered epoll.


Constructor & Destructor Documentation

EpollScheduler::EpollScheduler ( BlockingQueue< Microthread * > *  q = NULL  )  [protected]

Constructs a EpollScheduler running on queue q.

Parameters:
q is the queue the scheduler needs to insert itself


Member Function Documentation

EpollScheduler & EpollScheduler::create ( BlockingQueue< Microthread * > *  q = NULL  )  [static]

Named constructor for EpollScheduler.

The object is automatically deleted when run() returns.

Parameters:
q is the queue the scheduler needs to insert itself

void EpollScheduler::addReadCallback ( Callback cb,
int  fd 
) [virtual]

Tells this Scheduler to run cb when fd is readable.

This method must be overridden by derived classes. The Callback must not throw an exception when run.

Parameters:
cb is the Callback to be run
fd is the filedescriptor to be monitored

Implements BaseScheduler.

void EpollScheduler::addWriteCallback ( Callback cb,
int  fd 
) [virtual]

Tells this Scheduler to run cb when fd is writeable.

This method must be overridden by derived classes. The Callback must not throw an exception when run.

Parameters:
cb is the Callback to be run
fd is the filedescriptor to be monitored

Implements BaseScheduler.

void EpollScheduler::addWaitCallback ( Callback cb,
const timeval &  tv 
) [virtual]

Tells this Scheduler to run cb when tv is reached.

This method must be overridden by derived classes. The Callback must not throw an exception when run.

Parameters:
cb is the Callback to be run
tv is the absolute time to be reached

Implements BaseScheduler.

void EpollScheduler::run (  )  [virtual]

This method is run when the Microthread gets started.

It must be overridden by all derived classes.

Implements BaseScheduler.


The documentation for this class was generated from the following files:
Generated on Sat Feb 7 01:26:51 2009 by  doxygen 1.5.1