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