44#include <StormByte/type_traits/safe.hxx>
49#include <StormByte/platform.h>
50#include <StormByte/safe/optional.hxx>
51#include <StormByte/safe/pointers.hxx>
228 template<typename... Knobs>
230 (Apply(std::move(knobs)), ...);
254 void Apply(
class Chunk knob) {
255 m_chunk = knob.
Value();
263 m_high_water = knob.
Value();
271 template<
typename Knob>
272 void Apply(Knob&& knob) =
delete;
343 bool EoF() const noexcept;
Private worker for StormByte::Buffer::Pumper.
Manual bridge between two StormByte-Buffer ends.
Definition bridge.hxx:129
Pumper cycle size.
Definition pumper.hxx:82
Chunk(const StormByte::ByteSize value) noexcept
Store the cycle size.
Definition pumper.hxx:88
StormByte::ByteSize Value() const noexcept
Cycle size.
Definition pumper.hxx:95
Input occupancy cap for Pumper.
Definition pumper.hxx:114
HighWater(const StormByte::ByteSize value) noexcept
Store the input cap.
Definition pumper.hxx:120
StormByte::ByteSize Value() const noexcept
Input cap.
Definition pumper.hxx:127
Optional Pumper knobs.
Definition pumper.hxx:185
Parameters()=default
No knobs.
Parameters(const Parameters &other)=default
Copy provider-owned knob values; may allocate and throw.
const StormByte::Safe::Optional< StormByte::ByteSize > & HighWater() const noexcept
Input cap when the caller set it.
Definition pumper.hxx:245
const StormByte::Safe::Optional< StormByte::ByteSize > & Chunk() const noexcept
Cycle size when the caller set it.
Definition pumper.hxx:237
~Parameters() noexcept=default
Release knobs through their provider callbacks.
Parameters(Parameters &&other) noexcept=default
Transfer provider-owned knob values.
Owns a Bridge and moves bytes until EoF, failure or Cancel.
Definition pumper.hxx:176
const StormByte::Safe::Shared< StormByte::Buffer::WriteTelemetry > WriteTelemetry() const noexcept
Write counters copied from the owned Bridge.
bool Failed() const noexcept
Whether the owned Bridge failed for real.
bool EoF() const noexcept
Whether the owned Bridge reports EoF.
STORMBYTE_FORCE_INLINE Pumper(Bridge &&bridge, Parameters parameters={})
Take a Bridge and start the worker.
Definition pumper.hxx:289
void Cancel() noexcept
Terminal stop.
bool Canceled() const noexcept
Whether Cancel ran.
Pumper(const Pumper &other)=delete
Copying a worker is not supported.
Pumper(Pumper &&other) noexcept
Move constructor.
const StormByte::Safe::Shared< StormByte::Buffer::ReadTelemetry > ReadTelemetry() const noexcept
Read counters copied from the owned Bridge.
void Toggle() noexcept
Pause or resume the worker.
~Pumper() noexcept
Destructor.
STORMBYTE_DECLARE_MAYBE_SAFE(class StormByte::System::Device::Access)
PIMPL coordinators for public Buffer types that are not IO.
Buffer module of the StormByte suite.
Root namespace of the StormByte C++ suite.
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:54