Anonymous and named pipe control class.
More...
#include <pipes.hpp>
|
|
| Pipe () |
| | Creates an anonymous pipe (read + write side)
|
| | Pipe (String &name, OpenModeEnum mode) |
| | Create or open a named pipe.
|
| | Pipe (Pipe const &pipe) |
| | Create a copy by duplicating pipe handles.
|
| | Pipe (gate_pipe_t import_read_pipe, gate_pipe_t import_write_pipe) |
| | Create a pipe object by importing native pipe handles.
|
| bool_t | canRead () const |
| | Get readability state.
|
| bool_t | canWrite () const |
| | Get writability state.
|
| bool_t | dataAvailable () |
| | Returns true if read() can immediately return data without blocking.
|
| size_t | read (char *buffer, size_t bufferlen) |
| | Reads data from pipe into buffer and returns retrieved bytes.
|
| size_t | write (char const *buffer, size_t bufferlen) |
| | Writes bytes from buffer into pipe and returns actual transmitted bytes.
|
| String | exportRead () const |
| | Exports ID of read-pipe handle.
|
| String | exportWrite () const |
| | Exports ID of write-pipe handle.
|
|
| static Stream | openStream (String &name, OpenModeEnum mode=OpenMode_Create) |
| | Creates or opens a named pipe as a stream object.
|
Anonymous and named pipe control class.
◆ OpenModeEnum
Access mode flags for creating or opening pipes.
| Enumerator |
|---|
| OpenMode_Read | Create a new named pipe (with read and write acccess)
|
| OpenMode_Write | Open an existing named pipe for read access.
|
| OpenMode_ReadWrite | Open an existing named pipe for write access.
|
◆ Pipe() [1/3]
Create or open a named pipe.
- Parameters
-
| [in,out] | name | Reference to empty string to be filled with generated pipe name OR name of pipe to be opened |
| [in] | mode | see Pipe::OpenModeEnum |
◆ Pipe() [2/3]
Create a copy by duplicating pipe handles.
- Parameters
-
| [in] | pipe | Pipe object to be copied from |
◆ Pipe() [3/3]
Create a pipe object by importing native pipe handles.
- Parameters
-
| [in] | import_read_pipe | Handle of read-side of pipe |
| [in] | import_write_pipe | Handle of write-side of pipe |
◆ canRead()
Get readability state.
- Returns
- true if a read pipe handle is available
◆ canWrite()
| bool_t canWrite |
( |
| ) |
const |
Get writability state.
- Returns
- true if a write pipe handle is available
◆ dataAvailable()
Returns true if read() can immediately return data without blocking.
- Returns
- true if pipe has data to be read
◆ read()
| size_t read |
( |
char * | buffer, |
|
|
size_t | bufferlen ) |
Reads data from pipe into buffer and returns retrieved bytes.
- Parameters
-
| [out] | buffer | Pointer to buffer to be filled with retrieved bytes |
| [in] | bufferlen | Maximum capacity of buffer |
- Returns
- Actual amount of bytes retrieved from pipe
◆ write()
| size_t write |
( |
char const * | buffer, |
|
|
size_t | bufferlen ) |
Writes bytes from buffer into pipe and returns actual transmitted bytes.
- Parameters
-
| [in] | buffer | Pointer to buffer with data to be written to pipe |
| [in] | bufferlen | Length of buffer to be written to pipe |
- Returns
- Actual amount of bytes written to pipe
◆ exportRead()
| String exportRead |
( |
| ) |
const |
Exports ID of read-pipe handle.
- Returns
- String representing the read-pipe handle
◆ exportWrite()
| String exportWrite |
( |
| ) |
const |
Exports ID of write-pipe handle.
- Returns
- String representing the write-pipe handle
◆ openStream()
| Stream openStream |
( |
String & | name, |
|
|
OpenModeEnum | mode = OpenMode_Create ) |
|
static |
Creates or opens a named pipe as a stream object.
- Parameters
-
| [in,out] | name | Reference to string receiving new generated pipe-name OR name of pipe to be opened |
| [in] | mode | Create- or open mode of new pipe, see Pipe::OpenModeEnum |
- Returns
The documentation for this class was generated from the following files:
- src/gate/io/pipes.hpp
- src/gate/io/cxx_pipes.cpp