|
libcommonc++
0.7
|
A unidirectional stream pipe. More...
#include <Pipe.h++>
Public Member Functions | |
| Pipe () | |
| Constructor. More... | |
| ~Pipe () | |
| Destructor. More... | |
| void | open () |
| Create and open the pipe. More... | |
| void | close () |
| Close the pipe. More... | |
| bool | isOpen () const |
| Test if the pipe is open. More... | |
| ssize_t | read (byte_t *buf, size_t count) |
| Read raw data from the read end of the pipe. More... | |
| ssize_t | write (const byte_t *buf, size_t count) |
| Write raw data to the write end of the pipe. More... | |
| void | setBlocking (bool blocking) |
| Set the blocking state of the pipe. More... | |
| FileHandle | getReadDescriptor () const |
| Get the file descriptor for the read end of the pipe. More... | |
| FileHandle | getWriteDescriptor () const |
| Get the file descriptor for the write end of the pipe. More... | |
A unidirectional stream pipe.
The pipe has two file descriptors, one for reading, and one for writing.
| ~Pipe | ( | ) |
Destructor.
Closes the pipe if it is open.
| void close | ( | ) |
Close the pipe.
|
inline |
Get the file descriptor for the read end of the pipe.
|
inline |
Get the file descriptor for the write end of the pipe.
| bool isOpen | ( | ) | const |
Test if the pipe is open.
| void open | ( | ) |
Create and open the pipe.
| IOException | If an I/O error occurs. |
| ssize_t read | ( | byte_t * | buf, |
| size_t | count | ||
| ) |
Read raw data from the read end of the pipe.
| buf | The buffer to read into. |
| count | The number of bytes to read. |
| void setBlocking | ( | bool | blocking | ) |
Set the blocking state of the pipe.
| blocking | A flag indicating whether the pipe should be blocking or non-blocking. |
| IOException | If an I/O error occurs. |
| ssize_t write | ( | const byte_t * | buf, |
| size_t | count | ||
| ) |
Write raw data to the write end of the pipe.
| buf | The buffer to write. |
| count | The number of bytes to write. |