Open Lighting Architecture
0.9.1
|
This is the core of the event driven system. The SelectServer is responsible for invoking Callbacks when events occur. All methods except Execute() and Terminate() must be called from the thread that Run() was called in.
Public Types | |
enum | Direction { READ, WRITE } |
Public Member Functions | |
SelectServer (ola::ExportMap *export_map=NULL, Clock *clock=NULL) | |
bool | IsRunning () const |
const TimeStamp * | WakeUpTime () const |
void | Terminate () |
void | SetDefaultInterval (const TimeInterval &poll_interval) |
void | Run () |
void | RunOnce (unsigned int delay_sec=POLL_INTERVAL_SECOND, unsigned int delay_usec=POLL_INTERVAL_USECOND) |
bool | AddReadDescriptor (ReadFileDescriptor *descriptor) |
bool | AddReadDescriptor (ConnectedDescriptor *descriptor, bool delete_on_close=false) |
bool | RemoveReadDescriptor (ReadFileDescriptor *descriptor) |
bool | RemoveReadDescriptor (ConnectedDescriptor *descriptor) |
bool | AddWriteDescriptor (WriteFileDescriptor *descriptor) |
bool | RemoveWriteDescriptor (WriteFileDescriptor *descriptor) |
ola::thread::timeout_id | RegisterRepeatingTimeout (unsigned int ms, ola::Callback0< bool > *closure) |
ola::thread::timeout_id | RegisterRepeatingTimeout (const ola::TimeInterval &interval, ola::Callback0< bool > *closure) |
ola::thread::timeout_id | RegisterSingleTimeout (unsigned int ms, ola::SingleUseCallback0< void > *closure) |
ola::thread::timeout_id | RegisterSingleTimeout (const ola::TimeInterval &interval, ola::SingleUseCallback0< void > *closure) |
void | RemoveTimeout (ola::thread::timeout_id id) |
void | RunInLoop (ola::Callback0< void > *closure) |
void | Execute (ola::BaseCallback0< void > *closure) |
Friends | |
class | ::SelectServerTest |
|
virtual |
Execute this callback in the main select thread. This method can be called from any thread. The callback will never execute immediately, this can be used to perform delayed deletion of objects.
Implements ola::thread::ExecutorInterface.
void ola::io::SelectServer::Terminate | ( | ) |
A thread safe terminate