232 friend class StormByte::Buffer::Backend::IO::BufferedWriter;
233 friend class StormByte::Buffer::Backend::Bridge;
246 using WriterParameters::WriterParameters;
309 virtual explicit operator
bool() const noexcept final;
329 virtual
bool Open() final;
339 virtual
bool Close() final;
345 virtual
bool Rewind() final;
351 virtual
bool IsOpen() const noexcept final;
551 parameters.
MaxWait().value_or(
std::chrono::milliseconds{0}),
664 std::unique_ptr<StormByte::Buffer::Backend::IO::BufferedWriter> m_io;
Private pump for StormByte::Buffer::Bridge.
Private implementation of StormByte::Buffer::IO::BufferedWriter.
Byte-oriented FIFO buffer with grow-on-demand and close/error support.
Definition fifo.hxx:78
Writer ring cap in WriteChunk units.
Definition parameters.hxx:177
Writer knobs.
Definition buffered_writer.hxx:244
Coordinated binary write sink with optional chunked write-behind and a delayed-seek page map.
Definition buffered_writer.hxx:231
void SetTell(StormByte::ByteSize offset) noexcept
Publish the logical write offset from a leaf Seek.
virtual Result OriginFlush()=0
Make accepted bytes visible on the device.
virtual Result OriginPush(std::span< const std::byte > data)=0
Write data to the device.
virtual Result OriginClose()=0
Release the device and SetState Unavailable.
virtual void Setup()
Leaf policy hook.
virtual Result OriginTruncate()=0
Discard origin contents.
BufferedWriter(BufferedWriter &&other) noexcept
Move constructor.
virtual Result OriginSeek(StormByte::ByteSize absolute)
Seek the origin to absolute.
void SetState(enum State state) noexcept
Publish session state from a leaf hook.
virtual ~BufferedWriter() noexcept
Virtual destructor.
virtual StormByte::Shared< StormByte::Buffer::WriteTelemetry > CreateTelemetry() const
Allocate the telemetry object this instance will keep.
BufferedWriter(const BufferedWriter &)=delete
Copy constructor is deleted.
virtual Result OriginOpen()=0
Arm the device and SetState.
virtual bool WillWrite(StormByte::ByteSize n) const
Whether n more bytes can be accepted now.
BufferedWriter(StormByte::String::String path, enum Location location, StormByte::ByteSize write_chunk, std::size_t back_pressure, std::chrono::milliseconds max_wait, StormByte::ByteSize max_memory)
Construct an unopened coordinator (State::Unavailable).
Cache / dirty-page budget knob.
Definition parameters.hxx:102
Origin wait cap.
Definition parameters.hxx:127
Origin push unit.
Definition parameters.hxx:152
Writer counters on top of StormByte::Buffer::WriteTelemetry.
Definition telemetry.hxx:266
Optional writer knobs.
Definition parameters.hxx:274
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