CppUtils::System::PipeChannel
CLASSHigh-level RAII unidirectional anonymous IPC pipe channel with typed operations and timeout polling.
Public methods
Section titled “Public methods”Constructs an IPC pipe channel with close-on-exec (O_CLOEXEC) semantics.
| Parameter | Description |
|---|---|
nonBlocking | When true, sets O_NONBLOCK on both descriptor ends. |
Returns the raw file descriptor for the read end, or -1 if closed.
Returns the raw file descriptor for the write end, or -1 if closed.
Writes a contiguous byte span into the channel.
| Parameter | Description |
|---|---|
bytes | Data bytes to transmit. |
Returns: Total number of bytes written, or 0 if descriptor is closed.
Writes a text string into the channel.
| Parameter | Description |
|---|---|
text | Character string view to transmit. |
Returns: Total number of bytes written.
Writes a trivially copyable object directly into the channel.
| Parameter | Description |
|---|---|
value | Object reference to serialize as raw memory bytes. |
Reads up to buffer.size() bytes from the channel into the provided buffer.
| Parameter | Description |
|---|---|
buffer | Writable destination byte buffer. |
Returns: Number of bytes read(0 when the write end is closed or on end-of-stream).
Reads a complete trivially copyable object from the channel.
| Parameter | Description |
|---|---|
value | Destination object reference populated from raw bytes. |
Returns: True if the complete object was read; false on premature EOF.
Reads all remaining bytes from the channel until end-of-file.
Returns: Complete string containing all received bytes.