|
| PluginAdaptor (class DeviceManager *device_manager, ola::io::SelectServerInterface *select_server, ExportMap *export_map, class PreferencesFactory *preferences_factory, class PortBrokerInterface *port_broker, const std::string *instance_name) |
| Create a new PluginAdaptor. More...
|
|
bool | AddReadDescriptor (ola::io::ReadFileDescriptor *descriptor) |
| Register a ReadFileDescriptor for read-events. More...
|
|
bool | AddReadDescriptor (ola::io::ConnectedDescriptor *descriptor, bool delete_on_close=false) |
| Register a ConnectedDescriptor for read-events. More...
|
|
void | RemoveReadDescriptor (ola::io::ReadFileDescriptor *descriptor) |
| Remove a ReadFileDescriptor for read-events. More...
|
|
void | RemoveReadDescriptor (ola::io::ConnectedDescriptor *descriptor) |
| Remove a ConnectedDescriptor for read-events. More...
|
|
bool | AddWriteDescriptor (ola::io::WriteFileDescriptor *descriptor) |
| Register a WriteFileDescriptor for write-events. More...
|
|
void | RemoveWriteDescriptor (ola::io::WriteFileDescriptor *descriptor) |
| Remove a WriteFileDescriptor for write-events. More...
|
|
ola::thread::timeout_id | RegisterRepeatingTimeout (unsigned int ms, Callback0< bool > *closure) |
| Execute a callback periodically. More...
|
|
ola::thread::timeout_id | RegisterRepeatingTimeout (const TimeInterval &interval, Callback0< bool > *closure) |
| Execute a callback periodically. More...
|
|
ola::thread::timeout_id | RegisterSingleTimeout (unsigned int ms, SingleUseCallback0< void > *closure) |
| Execute a callback after a certain time interval. More...
|
|
ola::thread::timeout_id | RegisterSingleTimeout (const TimeInterval &interval, SingleUseCallback0< void > *closure) |
| Execute a callback after a certain time interval. More...
|
|
void | RemoveTimeout (ola::thread::timeout_id id) |
| Cancel an existing timeout. More...
|
|
void | Execute (ola::BaseCallback0< void > *closure) |
| Execute the supplied callback at some point in the future. More...
|
|
const TimeStamp * | WakeUpTime () const |
| The time when this SelectServer was woken up. More...
|
|
const std::string | InstanceName () const |
| Return the instance name for the OLA server. More...
|
|
ExportMap * | GetExportMap () const |
|
bool | RegisterDevice (class AbstractDevice *device) const |
| Register a device. More...
|
|
bool | UnregisterDevice (class AbstractDevice *device) const |
| Unregister a device. More...
|
|
class Preferences * | NewPreference (const std::string &name) const |
| Create a new preferences container. More...
|
|
class PortBrokerInterface * | GetPortBroker () const |
|
void | DrainCallbacks () |
| Run all callbacks until there are none left.
|
|
Register a ConnectedDescriptor for read-events.
- Parameters
-
descriptor | the ConnectedDescriptor to add. |
delete_on_close | if true, ownership of the ConnectedDescriptor is transferred to the SelectServer. |
- Returns
- true if the descriptor was added, false if the descriptor was previously added.
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.
Implements ola::io::SelectServerInterface.
Execute the supplied callback at some point in the future.
- Parameters
-
callback | the callback to run. |
This method provides the following guarantees:
- The callback will not be run immediately.
- The callback will be run at some point in the future. That is, the callback will not leak. Any remaining pending callbacks will be run during the destruction of the class implementing ExecutorInterface.
- For a given thread, callbacks will be run in the order in which they were added.
When queuing callbacks, you need to ensure that either:
- The objects used in the callback outlive the ExecutorInterface
- That the callback is run before the objects are deleted.
To achieve the latter it's common to keep track of the number of outstanding callbacks and then call DrainCallbacks() in the destructor if the number of outstanding callbacks is non-0.
Implements ola::thread::ExecutorInterface.