Open Lighting Architecture  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Files | Classes | Functions
I/O & Event Management

Detailed Description

The core event management system.

This defines all the different types of file descriptors that can be used by the SelectServer. At the top level, the ReadFileDescriptor / WriteFileDescriptor interfaces provide the minimum functionality needed to register a socket with the SelectServer to handle read / write events. The BidirectionalFileDescriptor extends this interface to handle both reading and writing.

The UnmanagedFileDescriptor allows socket descriptors created by other libraries to be used with the SelectServer.

ConnectedDescriptor is a socket with tighter intergration with the SelectServer. This allows the SelectServer to detect when the socket is closed and call the OnClose() handler. It also provides methods to disable SIGPIPE, control the blocking attributes and check how much data remains to be read. ConnectedDescriptor has the following sub-classes:


file  Descriptor.h


class  ola::io::ReadFileDescriptor
 Represents a file descriptor that supports reading data. More...
class  ola::io::WriteFileDescriptor
 Represents a file descriptor that supports writing data. More...
class  ola::io::BidirectionalFileDescriptor
 A file descriptor that supports both read & write. More...
class  ola::io::UnmanagedFileDescriptor
 Allows a FD created by a library to be used with the SelectServer. More...
struct  ola::io::UnmanagedFileDescriptor_lt
 Comparison operator for UnmanagedFileDescriptor. More...
class  ola::io::ConnectedDescriptor
 A BidirectionalFileDescriptor that also generates notifications when closed. More...
class  ola::io::LoopbackDescriptor
 A loopback descriptor. More...
class  ola::io::PipeDescriptor
 A descriptor that uses unix pipes. More...
class  ola::io::UnixSocket
 A unix domain socket pair. More...
class  ola::io::DeviceDescriptor
 A descriptor which represents a connection to a device. More...


int ola::io::ToFD (const DescriptorHandle &handle)

Function Documentation

int ola::io::ToFD ( const DescriptorHandle &  handle)

Helper function to convert a DescriptorHandle to a file descriptor.

handleThe descriptor handle
-1 on error, file descriptor otherwise