Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Static Protected Attributes | List of all members
ola::io::PollerInterface Class Reference

Detailed Description

The interface for the Poller classes.

Inheritance diagram for ola::io::PollerInterface:
ola::io::SelectPoller

Public Member Functions

virtual ~PollerInterface ()
 Destructor.
virtual bool AddReadDescriptor (ReadFileDescriptor *descriptor)=0
 Register a ReadFileDescriptor for read events.
virtual bool AddReadDescriptor (ConnectedDescriptor *descriptor, bool delete_on_close)=0
 Register a ConnectedDescriptor for read events.
virtual bool RemoveReadDescriptor (ReadFileDescriptor *descriptor)=0
 Unregister a ReadFileDescriptor for read events.
virtual bool RemoveReadDescriptor (ConnectedDescriptor *descriptor)=0
 Unregister a ConnectedDescriptor for read events.
virtual bool AddWriteDescriptor (WriteFileDescriptor *descriptor)=0
 Register a WriteFileDescriptor to receive ready-to-write events.
virtual bool RemoveWriteDescriptor (WriteFileDescriptor *descriptor)=0
 Unregister a WriteFileDescriptor for write events.
virtual const TimeStampWakeUpTime () const =0
virtual bool Poll (TimeoutManager *timeout_manager, const TimeInterval &poll_interval)=0
 Poll the Descriptors for events.

Static Public Attributes

static const char K_READ_DESCRIPTOR_VAR [] = "ss-read-descriptors"
 The number of descriptors registered for read events.
static const char K_WRITE_DESCRIPTOR_VAR [] = "ss-write-descriptor"
 The number of descriptors registered for write events.
static const char K_CONNECTED_DESCRIPTORS_VAR [] = "ss-connected-descriptors"
 The number of connected descriptors registered for read events.

Static Protected Attributes

static const char K_LOOP_TIME [] = "ss-loop-time"
 The time spent in the event loop.
static const char K_LOOP_COUNT [] = "ss-loop-count"
 The number of iterations through the event loop.

Member Function Documentation

virtual bool ola::io::PollerInterface::AddReadDescriptor ( ReadFileDescriptor descriptor)
pure virtual

Register a ReadFileDescriptor for read events.

Parameters
descriptorthe ReadFileDescriptor to register. The OnData() method will be called when there is data available for reading.
Returns
true if the descriptor was registered, false otherwise.

Implemented in ola::io::SelectPoller.

virtual bool ola::io::PollerInterface::AddReadDescriptor ( ConnectedDescriptor descriptor,
bool  delete_on_close 
)
pure virtual

Register a ConnectedDescriptor for read events.

Parameters
descriptorthe ConnectedDescriptor to register. The OnData() method will be called when there is data available for reading. Additionally, OnClose() will be called if the other end closes the connection.
delete_on_closecontrols whether the descriptor is deleted when it's closed.
Returns
true if the descriptor was registered, false otherwise.

Implemented in ola::io::SelectPoller.

virtual bool ola::io::PollerInterface::AddWriteDescriptor ( WriteFileDescriptor descriptor)
pure virtual

Register a WriteFileDescriptor to receive ready-to-write events.

Parameters
descriptorthe WriteFileDescriptor to register. The PerformWrite() method will be called when the descriptor is ready for writing.
Returns
true if the descriptor was registered, false otherwise.

Implemented in ola::io::SelectPoller.

virtual bool ola::io::PollerInterface::Poll ( TimeoutManager timeout_manager,
const TimeInterval poll_interval 
)
pure virtual

Poll the Descriptors for events.

Parameters
timeout_managerthe TimeoutManager to use for timer events.
poll_intervalthe maximum time to block for.
Returns
false if any errors occured, true if events were handled.

Implemented in ola::io::SelectPoller.

virtual bool ola::io::PollerInterface::RemoveReadDescriptor ( ReadFileDescriptor descriptor)
pure virtual

Unregister a ReadFileDescriptor for read events.

Parameters
descriptorthe ReadFileDescriptor to unregister.
Returns
true if unregistered successfully, false otherwise.

Implemented in ola::io::SelectPoller.

virtual bool ola::io::PollerInterface::RemoveReadDescriptor ( ConnectedDescriptor descriptor)
pure virtual

Unregister a ConnectedDescriptor for read events.

Parameters
descriptorthe ConnectedDescriptor to unregister.
Returns
true if unregistered successfully, false otherwise.

Implemented in ola::io::SelectPoller.

virtual bool ola::io::PollerInterface::RemoveWriteDescriptor ( WriteFileDescriptor descriptor)
pure virtual

Unregister a WriteFileDescriptor for write events.

Parameters
descriptorthe WriteFileDescriptor to unregister.
Returns
true if unregistered successfully, false otherwise.

Implemented in ola::io::SelectPoller.


The documentation for this class was generated from the following files: