212 friend class StormByte::Buffer::Backend::IO::BufferedReader;
225 using ReaderParameters::ReaderParameters;
288 virtual explicit operator
bool() const noexcept final;
309 virtual
bool Open() final;
324 virtual
bool Rewind() final;
330 virtual
bool IsOpen() const noexcept final;
336 virtual
bool IsReadable() const noexcept final;
343 virtual
bool EoF() const noexcept final;
440 virtual
bool IsSeekable() const noexcept final;
455 virtual
bool IsSized() const noexcept final;
553 parameters.
MaxWait().value_or(
std::chrono::milliseconds{0})) {}
567 std::chrono::milliseconds max_wait);
646 virtual
bool OriginHasSize() const noexcept = 0;
Private implementation of StormByte::Buffer::IO::BufferedReader.
Byte-oriented FIFO buffer with grow-on-demand and close/error support.
Definition fifo.hxx:78
Reader knobs.
Definition buffered_reader.hxx:223
Coordinated binary read source with optional prefetch and cache.
Definition buffered_reader.hxx:211
void SetState(enum State state) noexcept
Publish session state from a leaf hook.
BufferedReader(const BufferedReader &)=delete
Copy constructor is deleted.
BufferedReader(StormByte::String::String path, enum Location location, StormByte::ByteSize read_ahead, StormByte::ByteSize max_memory, std::chrono::milliseconds max_wait)
Construct an unopened coordinator (State::Unavailable).
virtual Result OriginClose()=0
Release the underlying device and SetState Unavailable.
virtual bool OriginCanSeek() const noexcept=0
Whether the device can seek.
virtual ~BufferedReader() noexcept
Virtual destructor.
virtual Result OriginPull(StormByte::ByteSize n, FIFO &dest)=0
Read up to n bytes from the device into dest.
virtual void Setup()
Leaf policy hook.
BufferedReader(BufferedReader &&other) noexcept
Move constructor.
virtual StormByte::Shared< StormByte::Buffer::ReadTelemetry > CreateTelemetry() const
Allocate the telemetry object this instance will keep.
virtual Result OriginOpen()=0
Arm the underlying device and SetState.
Cache / dirty-page budget knob.
Definition parameters.hxx:102
Origin wait cap.
Definition parameters.hxx:127
Prefetch length knob.
Definition parameters.hxx:77
Reader counters on top of StormByte::Buffer::ReadTelemetry.
Definition telemetry.hxx:87
Optional reader knobs.
Definition parameters.hxx:205
Base session counters.
Definition telemetry.hxx:82
Location
Where the bytes of a file-like source or sink live.
Definition typedefs.hxx:140
State
Session state of a coordinated reader or writer.
Definition typedefs.hxx:86
Position
Forward declaration of the WriteOnly interface.
Definition typedefs.hxx:73
Root namespace of the StormByte C++ suite.
Per-call status plus how many bytes this call transferred.
Definition typedefs.hxx:168
#define STORMBYTE_BUFFER_PUBLIC
Definition visibility.h:54