StormByte-Buffer 2.0.0
C++26 buffer module of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Buffer::Pipeline Class Referencefinal

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.
 

Detailed Description

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.

Execution modes
Flags combine with operator|:
  • Sync (0): pipes on the caller thread; Process blocks.
  • Async: work in background; Process returns immediately.
  • Parallel: one thread per pipe; without Async, Process joins.
  • Async | Parallel: concurrent pipes and non-blocking Process.
See also
Pipe, Producer, Consumer, Bridge, Pumper, ExecutionMode

Constructor & Destructor Documentation

◆ Pipeline() [1/3]

StormByte::Buffer::Pipeline::Pipeline ( )
noexcept

Construct an empty pipeline.

◆ Pipeline() [2/3]

StormByte::Buffer::Pipeline::Pipeline ( const Pipeline &  other)

Copy pipes only.

No running work is shared.

Parameters
otherSource pipeline.

◆ Pipeline() [3/3]

StormByte::Buffer::Pipeline::Pipeline ( Pipeline &&  other)
noexcept

Move constructor.

Parameters
otherSource pipeline.

◆ ~Pipeline()

StormByte::Buffer::Pipeline::~Pipeline ( )
noexcept

Join any background run, then destroy.

Member Function Documentation

◆ Add() [1/2]

void StormByte::Buffer::Pipeline::Add ( const Pipe &  pipe)

Clone pipe into this Pipeline.

pipe is not touched.

Parameters
pipeCaller pipe. Destroyed in the caller's TU.

◆ Add() [2/2]

void StormByte::Buffer::Pipeline::Add ( Pipe &&  pipe)

Take pipe by move into this Pipeline.

Parameters
pipeCaller pipe. Moved-from must not be used.

◆ operator=() [1/2]

Pipeline & StormByte::Buffer::Pipeline::operator= ( const Pipeline &  other)

Copy pipes only.

Parameters
otherSource pipeline.
Returns
*this.

◆ operator=() [2/2]

Pipeline & StormByte::Buffer::Pipeline::operator= ( Pipeline &&  other)
noexcept

Move assignment.

Parameters
otherSource pipeline.
Returns
*this.

◆ Process()

Consumer StormByte::Buffer::Pipeline::Process ( Consumer  buffer,
const StormByte::Shared< StormByte::Logger::Log > &  log,
const ExecutionMode &  mode 
) const
noexcept

Run the pipes.

Parameters
bufferFirst-pipe input. A stream Consumer.
logOptional. Pipes receive a scoped shared handle.
modeExecutionMode flags.
Returns
Consumer of the last pipe.

◆ SetError()

void StormByte::Buffer::Pipeline::SetError ( ) const
noexcept

SetError on every intermediate ring and the final Producer.


The documentation for this class was generated from the following file: