![]() |
Open Lighting Architecture
Latest Git
|
Classes for general I/O and event handling.
Classes | |
| class | BidirectionalFileDescriptor |
| A file descriptor that supports both read & write. More... | |
| class | BigEndianInputStream |
| class | BigEndianInputStreamAdaptor |
| class | BigEndianInputStreamInterface |
| class | BigEndianOutputStream |
| class | BigEndianOutputStreamAdaptor |
| class | BigEndianOutputStreamInterface |
| class | ConnectedDescriptor |
| A BidirectionalFileDescriptor that also generates notifications when closed. More... | |
| class | DeviceDescriptor |
| A descriptor which represents a connection to a device. More... | |
| class | EPollData |
| class | EPoller |
| An implementation of PollerInterface that uses epoll(). More... | |
| class | EventHolder |
| class | InputBufferInterface |
| class | InputStream |
| class | InputStreamInterface |
| class | IOQueue |
| class | IOStack |
| struct | IOVec |
| class | IOVecInterface |
| class | KQueueData |
| class | KQueuePoller |
| An implementation of PollerInterface that uses kevent / kqueue. More... | |
| class | LinuxHelper |
| A static class containing platform-specific helper code for Linux. More... | |
| class | LoopbackDescriptor |
| A loopback descriptor. More... | |
| class | MemoryBlock |
| A MemoryBlock encapsulates a chunk of memory. It's used by the IOQueue and IOStack classes. More... | |
| class | MemoryBlockPool |
| MemoryBlockPool. This class is not thread safe. More... | |
| class | MemoryBuffer |
| class | NonBlockingSender |
| Write data to ConnectedDescriptors without blocking or losing data. More... | |
| class | OutputBufferInterface |
| class | OutputStream |
| class | OutputStreamInterface |
| class | PipeDescriptor |
| A descriptor that uses unix pipes. More... | |
| class | PollData |
| class | PollerInterface |
| The interface for the Poller classes. More... | |
| class | ReadFileDescriptor |
| Represents a file descriptor that supports reading data. More... | |
| class | SelectPoller |
| An implementation of PollerInterface that uses select(). More... | |
| class | SelectServer |
| A single threaded I/O event management system. More... | |
| class | SelectServerInterface |
| The interface for the SelectServer. More... | |
| class | StdinHandler |
| class | TimeoutManager |
| Manages timer events. More... | |
| class | UnixSocket |
| A unix domain socket pair. More... | |
| class | UnmanagedFileDescriptor |
| Allows a FD created by a library to be used with the SelectServer. More... | |
| struct | UnmanagedFileDescriptor_lt |
| Comparison operator for UnmanagedFileDescriptor. More... | |
| class | WindowsPoller |
| An implementation of PollerInterface for Windows. More... | |
| class | WindowsPollerDescriptor |
| class | WriteFileDescriptor |
| Represents a file descriptor that supports writing data. More... | |
Typedefs | |
| typedef std::basic_string< uint8_t > | ByteString |
| A contiguous block of uint8_t data. More... | |
| typedef int | DescriptorHandle |
Enumerations | |
| enum | baud_rate { BAUD_RATE_9600 = 9600, BAUD_RATE_19200 = 19200, BAUD_RATE_38400 = 38400, BAUD_RATE_57600 = 57600, BAUD_RATE_115200 = 115200, BAUD_RATE_230400 = 230400 } |
Functions | |
| STATIC_ASSERT (sizeof(struct iovec)==sizeof(struct IOVec)) | |
| int | ToFD (const DescriptorHandle &handle) |
| bool | CreatePipe (DescriptorHandle handle_pair[2]) |
| bool | Open (const std::string &path, int oflag, int *fd) |
| Wrapper around open(). More... | |
| bool | TryOpen (const std::string &path, int oflag, int *fd) |
| Wrapper around open(). More... | |
| bool | FileExists (const std::string &file_name) |
| Check if a file exists using stat(). More... | |
| template<typename T > | |
| bool | InsertIntoDescriptorMap (map< int, T *> *descriptor_map, int fd, T *value, const string &type) |
| Insert a descriptor into one of the descriptor maps. More... | |
| template<typename T > | |
| bool | RemoveFromDescriptorMap (map< int, T *> *descriptor_map, int fd) |
| Remove a FD from a descriptor map by setting the value to NULL. More... | |
| bool | UIntToSpeedT (uint32_t value, speed_t *output) |
| Convert an integer baud rate to the termios struct speed_t. More... | |
| bool | AcquireUUCPLockAndOpen (const std::string &path, int oflag, int *fd) |
| Try to open the path, respecting UUCP locking. More... | |
| void | ReleaseUUCPLock (const std::string &path) |
| Remove a UUCP lock file for the device. More... | |
| void | CancelIOs (vector< PollData *> *data) |
Variables | |
| static const int | FLAG_READ = 1 |
| static const int | FLAG_WRITE = 2 |
| static DescriptorHandle | INVALID_DESCRIPTOR = -1 |
| typedef std::basic_string<uint8_t> ola::io::ByteString |
A contiguous block of uint8_t data.
The constraints of the .data() and .c_str() methods from the C++ standard mean that string stores it's data in a contiguous block.
In some implementations, basic_string may be reference counted, but with the additional constraints added by C++11 this will not be the case, so think twice about copying ByteStrings.
| bool ola::io::AcquireUUCPLockAndOpen | ( | const std::string & | path, |
| int | oflag, | ||
| int * | fd | ||
| ) |
Try to open the path, respecting UUCP locking.
| path | the path to open | |
| oflag | flags passed to open | |
| [out] | fd | a pointer to the fd which is returned. |
This fails-fast, it we can't get the lock immediately, we'll return false.
| bool ola::io::CreatePipe | ( | DescriptorHandle | handle_pair[2] | ) |
Helper function to create a anonymous pipe
| handle_pair | a 2 element array which is updated with the handles |
| bool ola::io::FileExists | ( | const std::string & | file_name | ) |
Check if a file exists using stat().
| file_name | The name of the file. |
| bool ola::io::InsertIntoDescriptorMap | ( | map< int, T *> * | descriptor_map, |
| int | fd, | ||
| T * | value, | ||
| const string & | type | ||
| ) |
Insert a descriptor into one of the descriptor maps.
| descriptor_map | the descriptor_map to insert into. |
| fd | the FD to use as the key |
| value | the value to associate with the key |
| type | the name of the map, used for logging if the fd already exists in the map. |
There are three possibilities:
| bool ola::io::Open | ( | const std::string & | path, |
| int | oflag, | ||
| int * | fd | ||
| ) |
Wrapper around open().
This logs a message if the open fails.
| path | the path to open | |
| oflag | flags passed to open | |
| [out] | fd | a pointer to the fd which is returned. |
| void ola::io::ReleaseUUCPLock | ( | const std::string & | path | ) |
Remove a UUCP lock file for the device.
| path | The path to unlock. |
The lock is only removed if the PID matches.
| bool ola::io::RemoveFromDescriptorMap | ( | map< int, T *> * | descriptor_map, |
| int | fd | ||
| ) |
Remove a FD from a descriptor map by setting the value to NULL.
| bool ola::io::TryOpen | ( | const std::string & | path, |
| int | oflag, | ||
| int * | fd | ||
| ) |
| bool ola::io::UIntToSpeedT | ( | uint32_t | value, |
| speed_t * | output | ||
| ) |
Convert an integer baud rate to the termios struct speed_t.
| [in] | value | the baudrate value to convert |
| [out] | output | a pointer where the value will be stored |
1.8.13