ONPOSIX
2.0
|
Abstraction of a fifo (AKA "named pipe") descriptor. More...
#include <FifoDescriptor.hpp>
Public Member Functions | |
FifoDescriptor (const std::string &name, const int flags) | |
Constructor for descriptors of fifos. | |
FifoDescriptor (const std::string &name, const int flags, const mode_t mode) | |
Constructor for descriptors of fifos. | |
int | getCapacity () |
Method to get the capacity of the fifo. | |
Public Member Functions inherited from PosixDescriptor | |
virtual | ~PosixDescriptor () |
Destructor. | |
void | async_read (void(*handler)(Buffer *b, size_t size), Buffer *b, size_t size) |
Run asynchronous read operation. | |
void | async_read (void(*handler)(void *b, size_t size), void *b, size_t size) |
Run asynchronous read operation. | |
void | async_write (void(*handler)(Buffer *b, size_t size), Buffer *b, size_t size) |
Run asynchronous write operation. | |
void | async_write (void(*handler)(void *b, size_t size), void *b, size_t size) |
Run asynchronous write operation. | |
int | read (Buffer *b, size_t size) |
Method to read from the descriptor and fill a buffer. | |
int | read (void *p, size_t size) |
Method to read from the descriptor. | |
int | write (Buffer *b, size_t size) |
Method to write data in a buffer to the descriptor. | |
int | write (const void *p, size_t size) |
Method to write to the descriptor. | |
int | write (const std::string &s) |
Method to write a string to the descriptor. | |
virtual void | close () |
Method to close the descriptor. | |
int | getDescriptorNumber () const |
Method to get descriptor number. | |
PosixDescriptor (const PosixDescriptor &src) | |
Copy constructor. | |
PosixDescriptor & | operator= (const PosixDescriptor &src) |
Assignment operator. | |
bool | flush () |
Method to flush this specific descriptor. | |
int | ioctl (int request) |
Ioctl on the file descriptor. | |
int | ioctl (int request, void *argp) |
Ioctl on the file descriptor. |
Additional Inherited Members | |
Protected Member Functions inherited from PosixDescriptor | |
int | do_read (void *p, size_t size) |
Low-level read. | |
int | do_write (const void *p, size_t size) |
Low-level write. | |
PosixDescriptor () | |
Constructor. | |
Protected Attributes inherited from PosixDescriptor | |
int | fd_ |
Number of the file descriptor. |
Abstraction of a fifo (AKA "named pipe") descriptor.
This is an abstract class for the concept of fifo. The descriptor corresponds to an open fifo.
Example of usage:
Definition at line 41 of file FifoDescriptor.hpp.
FifoDescriptor | ( | const std::string & | name, |
const int | flags | ||
) |
Constructor for descriptors of fifos.
It calls open() with the given flags.
name | of the fifo |
flags | that can be
|
runtime_error | if the ::open() returns an error |
Definition at line 49 of file FifoDescriptor.cpp.
FifoDescriptor | ( | const std::string & | name, |
const int | flags, | ||
const mode_t | mode | ||
) |
Constructor for descriptors of fifos.
It calls open() with the given flags.
name | of the file |
flags | that can be
|
mode | can be
|
runtime_error | if the ::open() returns an error |
Definition at line 96 of file FifoDescriptor.cpp.
int getCapacity | ( | ) |
Method to get the capacity of the fifo.
runtime_error | in case it's not possible to get the capacity |
Definition at line 115 of file FifoDescriptor.cpp.