SelectScheduler Class Reference

Reference implementation for schedulers. More...

#include <selectscheduler.h>

Inheritance diagram for SelectScheduler:

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 addExceptCallback (Callback &cb, int fd)
 Works like addReadCallback for exceptions on file descriptors.
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 SelectSchedulercreate (BlockingQueue< Microthread * > *q=NULL)
 Named constructor for SelectScheduler.

Protected Member Functions

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

Detailed Description

Reference implementation for schedulers.


Constructor & Destructor Documentation

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

Constructs a SelectScheduler running on queue q.

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


Member Function Documentation

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

Named constructor for SelectScheduler.

The object is automatically deleted when run() returns.

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

void SelectScheduler::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 SelectScheduler::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 SelectScheduler::addExceptCallback ( Callback cb,
int  fd 
)

Works like addReadCallback for exceptions on file descriptors.

See select 2 man page.

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

void SelectScheduler::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 SelectScheduler::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