Open Lighting Architecture
0.9.3
|
The interface for the SelectServer.
The SelectServerInterface is used to register Descriptors for events. It's the core of the event manager system, and should really be called IOManager.
SelectServerInterface implementations are required to be reentrant. Descriptors may be added / removed and timeouts set / canceled from within callbacks executed by the SelectServer.
Public Member Functions | |
virtual bool | AddReadDescriptor (class ReadFileDescriptor *descriptor)=0 |
Register a ReadFileDescriptor for read-events. | |
virtual bool | AddReadDescriptor (class ConnectedDescriptor *descriptor, bool delete_on_close=false)=0 |
Register a ConnectedDescriptor for read-events. | |
virtual void | RemoveReadDescriptor (class ReadFileDescriptor *descriptor)=0 |
Remove a RemoveReadDescriptor for read-events. | |
virtual void | RemoveReadDescriptor (class ConnectedDescriptor *descriptor)=0 |
Remove a ConnectedDescriptor for read-events. | |
virtual bool | AddWriteDescriptor (class WriteFileDescriptor *descriptor)=0 |
Register a WriteFileDescriptor for write-events. | |
virtual void | RemoveWriteDescriptor (class WriteFileDescriptor *descriptor)=0 |
Remove a WriteFileDescriptor for write-events. | |
virtual ola::thread::timeout_id | RegisterRepeatingTimeout (unsigned int ms, Callback0< bool > *closure)=0 |
Execute a callback periodically. | |
virtual ola::thread::timeout_id | RegisterRepeatingTimeout (const ola::TimeInterval &interval, ola::Callback0< bool > *closure)=0 |
Execute a callback periodically. | |
virtual ola::thread::timeout_id | RegisterSingleTimeout (unsigned int ms, SingleUseCallback0< void > *closure)=0 |
Execute a callback after a certain time interval. | |
virtual ola::thread::timeout_id | RegisterSingleTimeout (const ola::TimeInterval &interval, SingleUseCallback0< void > *closure)=0 |
Execute a callback after a certain time interval. | |
virtual void | RemoveTimeout (ola::thread::timeout_id id)=0 |
Cancel an existing timeout. | |
virtual const TimeStamp * | WakeUpTime () const =0 |
The time when this SelectServer was woken up. |
|
pure virtual |
Register a ReadFileDescriptor for read-events.
descriptor | the ReadFileDescriptor to add. |
When the descriptor is ready for reading, PerformRead() will be called.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Register a ConnectedDescriptor for read-events.
descriptor | the ConnectedDescriptor to add. |
delete_on_close | if true, ownership of the ConnectedDescriptor is transferred to the SelectServer. |
When the descriptor is ready for reading, PerformRead() will be called. Prior to PerformRead(), IsClosed() is called. If this returns true, and delete_on_close was set, the descriptor will be deleted.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Register a WriteFileDescriptor for write-events.
descriptor | the WriteFileDescriptor to add. |
When the descriptor is writeable, PerformWrite() is called.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Execute a callback periodically.
period | the number of milliseconds between each execution of the callback. |
callback | the callback to run. Ownership is transferred. |
Returning false from the callback will cause it to be cancelled.
Implements ola::thread::SchedulerInterface.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Execute a callback periodically.
period | the time interval between each execution of the callback. |
callback | the callback to run. Ownership is transferred. |
Returning false from the callback will cause it to be cancelled.
Implements ola::thread::SchedulerInterface.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Execute a callback after a certain time interval.
delay | the number of milliseconds before the callback is executed. |
callback | the callback to run. Ownership is transferred. |
Implements ola::thread::SchedulerInterface.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Execute a callback after a certain time interval.
delay | the time interval to wait before the callback is executed. |
callback | the callback to run. Ownership is transferred. |
Implements ola::thread::SchedulerInterface.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Remove a RemoveReadDescriptor for read-events.
descriptor | the descriptor to remove. |
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Remove a ConnectedDescriptor for read-events.
descriptor | the descriptor to remove. |
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Cancel an existing timeout.
id | the timeout_id returned by a call to RegisterRepeatingTimeout or RegisterSingleTimeout. |
Implements ola::thread::SchedulerInterface.
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
Remove a WriteFileDescriptor for write-events.
descriptor | the descriptor to remove. |
Implemented in ola::io::SelectServer, and ola::PluginAdaptor.
|
pure virtual |
The time when this SelectServer was woken up.
If running within the same thread as the SelectServer, this is a efficient way to get the current time.
Implemented in ola::PluginAdaptor, and ola::io::SelectServer.