#include <selectscheduler.h>
Inheritance diagram for SelectScheduler:
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 SelectScheduler & | create (BlockingQueue< Microthread * > *q=NULL) |
Named constructor for SelectScheduler. | |
Protected Member Functions | |
SelectScheduler (BlockingQueue< Microthread * > *q=NULL) | |
Constructs a SelectScheduler running on queue q. |
SelectScheduler::SelectScheduler | ( | BlockingQueue< Microthread * > * | q = NULL |
) | [protected] |
Constructs a SelectScheduler running on queue q.
q | is the queue the scheduler needs to insert itself |
SelectScheduler & SelectScheduler::create | ( | BlockingQueue< Microthread * > * | q = NULL |
) | [static] |
Named constructor for SelectScheduler.
The object is automatically deleted when run() returns.
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.
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.
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.
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.
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.