CppUtils::System::PipeChannel
CLASSHigh-level RAII unidirectional anonymous IPC pipe channel with typed operations and timeout polling.
Méthodes publiques
Section intitulée « Méthodes publiques »Constructs an IPC pipe channel with close-on-exec (O_CLOEXEC) semantics.
| Paramètre | 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.
| Paramètre | Description |
|---|---|
bytes | Data bytes to transmit. |
Retourne : Total number of bytes written, or 0 if descriptor is closed.
Writes a text string into the channel.
| Paramètre | Description |
|---|---|
text | Character string view to transmit. |
Retourne : Total number of bytes written.
Writes a trivially copyable object directly into the channel.
| Paramètre | Description |
|---|---|
value | Object reference to serialize as raw memory bytes. |
Reads up to buffer.size() bytes from the channel into the provided buffer.
| Paramètre | Description |
|---|---|
buffer | Writable destination byte buffer. |
Retourne : 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.
| Paramètre | Description |
|---|---|
value | Destination object reference populated from raw bytes. |
Retourne : True if the complete object was read; false on premature EOF.
Reads all remaining bytes from the channel until end-of-file.
Retourne : Complete string containing all received bytes.
Waits for incoming data or pipe hangup until the specified timeout expires.
| Paramètre | Description |
|---|---|
timeout | Maximum duration to wait. |
Retourne : True if data is available or hangup occurred; false on timeout or error.