Multi-pipe byte transformation over stream buffers. More...
#include <StormByte/buffer/pipeline.hxx>
Public Member Functions | |
Lifecycle | |
| Pipeline () noexcept | |
| Construct an empty pipeline. | |
| Pipeline (const Pipeline &other) | |
| Copy pipes only. | |
| Pipeline (Pipeline &&other) noexcept | |
| Move constructor. | |
| ~Pipeline () noexcept | |
| Join any background run, then destroy. | |
| Pipeline & | operator= (const Pipeline &other) |
| Copy pipes only. | |
| Pipeline & | operator= (Pipeline &&other) noexcept |
| Move assignment. | |
Pipes | |
| void | Add (const Pipe &pipe) |
Clone pipe into this Pipeline. | |
| void | Add (Pipe &&pipe) |
Take pipe by move into this Pipeline. | |
Execution | |
| void | SetError () const noexcept |
| SetError on every intermediate ring and the final Producer. | |
| Consumer | Process (Consumer buffer, const StormByte::Shared< StormByte::Logger::Log > &log, const ExecutionMode &mode) const noexcept |
| Run the pipes. | |
Multi-pipe byte transformation over stream buffers.
This type is for ReadOnly / WriteOnly ends (Consumer, Producer, FIFO, Ring, and the like). It does not take IO leaves. File or device origins join the tube through Bridge / Pumper: run Process on a Consumer and pass that Consumer to a Bridge, or the other way around.
Each Pipe receives the previous end and writes the next. Intermediate pipes use a private SPSC ring; the last writes a public Producer. Add clones or moves the pipe onto Base's heap. A const add leaves the caller's Pipe untouched; that object is destroyed in the caller's translation unit.
operator|:
|
noexcept |
Construct an empty pipeline.
| StormByte::Buffer::Pipeline::Pipeline | ( | const Pipeline & | other | ) |
Copy pipes only.
No running work is shared.
| other | Source pipeline. |
|
noexcept |
Move constructor.
| other | Source pipeline. |
|
noexcept |
Join any background run, then destroy.
| void StormByte::Buffer::Pipeline::Add | ( | const Pipe & | pipe | ) |
Clone pipe into this Pipeline.
pipe is not touched.
| pipe | Caller pipe. Destroyed in the caller's TU. |
| void StormByte::Buffer::Pipeline::Add | ( | Pipe && | pipe | ) |
Take pipe by move into this Pipeline.
| pipe | Caller pipe. Moved-from must not be used. |
Copy pipes only.
| other | Source pipeline. |
Move assignment.
| other | Source pipeline. |
|
noexcept |
Run the pipes.
| buffer | First-pipe input. A stream Consumer. |
| log | Optional. Pipes receive a scoped shared handle. |
| mode | ExecutionMode flags. |
|
noexcept |
SetError on every intermediate ring and the final Producer.