StormByte-Buffer 2.0.0
C++26 buffer module of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Buffer Namespace Reference

Buffer module of the StormByte suite. More...

Namespaces

namespace  Backend
 PIMPL coordinators for public Buffer types that are not IO.
 
namespace  IO
 Buffered binary sources and sinks.
 

Classes

class  Bridge
 Manual bridge between two StormByte-Buffer ends. More...
 
class  Chunk
 Pumper cycle size. More...
 
class  Consumer
 Read-oriented handle over a shared Ring. More...
 
class  Error
 General exception for buffer errors. More...
 
class  Exception
 Root exception for Buffer. More...
 
struct  ExternalReaderDeleter
 Destroys a non-IO read adapter in this module. More...
 
struct  ExternalWriterDeleter
 Destroys a non-IO write adapter in this module. More...
 
class  FIFO
 Byte-oriented FIFO buffer with grow-on-demand and close/error support. More...
 
class  Generic
 Abstract root of the byte-buffer interfaces. More...
 
class  HighWater
 Input occupancy cap for Pumper. More...
 
class  Hopper
 Single-producer single-consumer (SPSC) typed item queue. More...
 
class  Pipe
 One transformation in a Pipeline. More...
 
class  Pipeline
 Multi-pipe byte transformation over stream buffers. More...
 
class  Producer
 Write-only handle over a shared Ring. More...
 
class  Pumper
 Owns a Bridge and moves bytes until EoF, failure or Cancel. More...
 
class  ReadError
 Read, extract or peek failed. More...
 
class  ReadOnly
 Buffer that can be read and not written. More...
 
class  ReadTelemetry
 Basic read counters. More...
 
class  ReadWrite
 Read and write interface. More...
 
class  Ring
 High-performance, highly-concurrent thread-safe ring buffer. More...
 
class  SharedFIFO
 Thread-safe FIFO built on top of FIFO. More...
 
class  Sink
 Set of Hopper buckets keyed by an integer. More...
 
class  Telemetry
 Base session counters. More...
 
class  WriteError
 Write failed. More...
 
class  WriteOnly
 Buffer that can be written and not read. More...
 
class  WriteTelemetry
 Basic write counters. More...
 

Enumerations

enum class  Position { Absolute , Relative }
 Forward declaration of the WriteOnly interface. More...
 
enum class  ExecutionMode : unsigned { Sync = 0 , Async = 1u << 0 , Parallel = 1u << 1 }
 Bitmask controlling how Pipeline::Process schedules work. More...
 

Functions

constexpr ExecutionMode operator| (ExecutionMode a, ExecutionMode b) noexcept
 Bitwise OR of execution flags.
 
constexpr ExecutionMode operator& (ExecutionMode a, ExecutionMode b) noexcept
 Bitwise AND of execution flags.
 
constexpr ExecutionMode & operator|= (ExecutionMode &a, ExecutionMode b) noexcept
 Bitwise OR-assignment of execution flags.
 
constexpr bool HasExecutionFlag (ExecutionMode mode, ExecutionMode flag) noexcept
 Whether mode includes all bits of flag.
 

Detailed Description

Buffer module of the StormByte suite.

Enumeration Type Documentation

◆ ExecutionMode

enum class StormByte::Buffer::ExecutionMode : unsigned
strong

Bitmask controlling how Pipeline::Process schedules work.

Flags are orthogonal and may be combined with operator|.

  • Sync (0) — no flags: stages run sequentially on the caller’s thread; Pipeline::Process blocks until completion.
  • Async — run work on background thread(s); Pipeline::Process returns immediately with the final Consumer.
  • Parallel — one thread per stage (pipeline parallelism via SPSC intermediate rings). Without Async, Pipeline::Process still waits for all stages to finish before returning.

Typical combinations:

Expression Stages Process()
Sync (or 0) sequential, caller blocks
Async sequential, 1 worker returns now
Parallel 1 thread per stage blocks
Async | Parallel 1 thread per stage returns now
Note
Prefer Async | Parallel for multi-stage streaming production. Use Sync for deterministic debugging.
See also
Pipeline::Process(), HasExecutionFlag()
Enumerator
Sync 

Sequential on caller thread; Process blocks.

Async 

Background execution; Process returns immediately.

Parallel 

One thread per stage (pipeline parallelism).

◆ Position

enum class StormByte::Buffer::Position
strong

Forward declaration of the WriteOnly interface.

Positioning mode for buffer seek / non-destructive read operations.

Defines how offset values are interpreted by Seek() and related APIs.

See also
ReadOnly::Seek()
Enumerator
Absolute 

Offset from the beginning of the buffer (position 0).

Relative 

Offset from the current logical read position.

Function Documentation

◆ HasExecutionFlag()

constexpr bool StormByte::Buffer::HasExecutionFlag ( ExecutionMode  mode,
ExecutionMode  flag 
)
inlineconstexprnoexcept

Whether mode includes all bits of flag.

Parameters
modeCombined mode value.
flagFlag (or flag set) to test.
Returns
true if every bit in flag is set in mode.

◆ operator&()

constexpr ExecutionMode StormByte::Buffer::operator& ( ExecutionMode  a,
ExecutionMode  b 
)
inlineconstexprnoexcept

Bitwise AND of execution flags.

Parameters
aLeft-hand flags.
bRight-hand flags.
Returns
Intersection of flag sets.

◆ operator|()

constexpr ExecutionMode StormByte::Buffer::operator| ( ExecutionMode  a,
ExecutionMode  b 
)
inlineconstexprnoexcept

Bitwise OR of execution flags.

Parameters
aLeft-hand flags.
bRight-hand flags.
Returns
Combined flag set.

◆ operator|=()

constexpr ExecutionMode & StormByte::Buffer::operator|= ( ExecutionMode &  a,
ExecutionMode  b 
)
inlineconstexprnoexcept

Bitwise OR-assignment of execution flags.

Parameters
aFlags to update.
bFlags to add.
Returns
Reference to a.