Open Lighting Architecture: I/O & Event Management

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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 integration 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:

- LoopbackDescriptor this socket is just a pipe(). Data written to the socket is available to be read.
- PipeDescriptor allows a pair of sockets to be created. Data written to socket A is available at FileDescriptor B and visa versa.
- UnixSocket, similar to PipeDescriptor but uses unix domain sockets.
- DeviceDescriptor, this is a generic ConnectedDescriptor. It can be used with file descriptors to handle local devices.

## Files
file | Descriptor.h

## Classes
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...

## Functions
int | ola::io::ToFD (const DescriptorHandle &handle)

## Function Documentation

## ◆ ToFD()

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

Helper function to convert a DescriptorHandle to a file descriptor.

Parameters

  handle | The descriptor handle

Returns
  -1 on error, file descriptor otherwise