44#include <StormByte/type_traits/safe.hxx>
46#include <StormByte/byte_size.hxx>
47#include <StormByte/platform.h>
48#include <StormByte/safe/optional.hxx>
49#include <StormByte/type_traits.hxx>
338 explicit MaxWait(
const std::chrono::milliseconds value)
noexcept:
345 std::chrono::milliseconds
Value() const noexcept {
353 std::chrono::milliseconds m_value;
401 std::size_t
Value() const noexcept {
432 template<
typename... Knobs>
434 (Apply(std::move(knobs)), ...);
506 m_read_chunk = knob.
Value();
514 m_read_ahead = knob.Value();
522 m_max_memory = knob.Value();
529 void Apply(
class MaxWait knob) {
530 m_max_wait = knob.Value().count();
537 template<
typename Knob>
538 void Apply(Knob&&) =
delete;
540 StormByte::Safe::Optional<StormByte::ByteSize> m_read_chunk;
544 StormByte::Safe::Optional<StormByte::ByteSize> m_read_ahead;
548 StormByte::Safe::Optional<StormByte::ByteSize> m_max_memory;
552 StormByte::Safe::Optional<std::chrono::milliseconds::rep> m_max_wait;
575 template<
typename... Knobs>
577 (Apply(std::move(knobs)), ...);
616 return m_write_transfer;
624 return m_write_threshold;
632 return m_write_chunk;
640 return m_back_pressure;
665 m_write_transfer = knob.
Value();
673 m_write_threshold = knob.Value();
681 m_write_chunk = knob.Value();
689 m_back_pressure = knob.Value();
697 m_max_memory = knob.Value();
704 void Apply(
class MaxWait knob) {
705 m_max_wait = knob.Value().count();
712 template<
typename Knob>
713 void Apply(Knob&&) =
delete;
715 StormByte::Safe::Optional<StormByte::ByteSize> m_write_transfer;
716 StormByte::Safe::Optional<StormByte::ByteSize> m_write_threshold;
720 StormByte::Safe::Optional<StormByte::ByteSize> m_write_chunk;
724 StormByte::Safe::Optional<std::size_t> m_back_pressure;
728 StormByte::Safe::Optional<StormByte::ByteSize> m_max_memory;
732 StormByte::Safe::Optional<std::chrono::milliseconds::rep> m_max_wait;
Writer ring cap in WriteChunk units.
Definition parameters.hxx:388
BackPressure(const std::size_t value) noexcept
Store the cap in chunks.
Definition parameters.hxx:394
std::size_t Value() const noexcept
Cap in chunks.
Definition parameters.hxx:401
Cache / dirty-page budget knob.
Definition parameters.hxx:304
MaxMemory(const StormByte::ByteSize value) noexcept
Store the memory budget.
Definition parameters.hxx:310
StormByte::ByteSize Value() const noexcept
Memory budget.
Definition parameters.hxx:317
Origin wait cap.
Definition parameters.hxx:332
std::chrono::milliseconds Value() const noexcept
Wait cap.
Definition parameters.hxx:345
MaxWait(const std::chrono::milliseconds value) noexcept
Store the wait cap.
Definition parameters.hxx:338
Prefetch length knob.
Definition parameters.hxx:276
StormByte::ByteSize Value() const noexcept
Prefetch length.
Definition parameters.hxx:289
ReadAhead(const StormByte::ByteSize value) noexcept
Store the prefetch length.
Definition parameters.hxx:282
Maximum OriginPull request.
Definition parameters.hxx:78
StormByte::ByteSize Value() const noexcept
Requested transfer maximum.
Definition parameters.hxx:121
ReadChunk(StormByte::ByteSize value) noexcept
Store the requested transfer limit.
Definition parameters.hxx:84
ReadChunk(const ReadChunk &other) noexcept=default
Copy the limit.
~ReadChunk() noexcept=default
Destroy the non-owning limit.
ReadChunk(ReadChunk &&other) noexcept=default
Move the limit.
Optional reader knobs.
Definition parameters.hxx:420
const StormByte::Safe::Optional< std::chrono::milliseconds::rep > & MaxWait() const noexcept
Signed millisecond count when the caller set the wait cap.
Definition parameters.hxx:496
ReaderParameters(Knobs... knobs)
Engage the listed knobs.
Definition parameters.hxx:433
ReaderParameters(ReaderParameters &&other) noexcept=default
Transfer Safe-owned optional knobs.
~ReaderParameters() noexcept=default
Release optional knobs through provider callbacks.
ReaderParameters(const ReaderParameters &other)=default
Copy Safe-owned optional knobs; may allocate and throw.
ReaderParameters()=default
No knobs.
const StormByte::Safe::Optional< StormByte::ByteSize > & ReadAhead() const noexcept
Prefetch length when the caller set it.
Definition parameters.hxx:480
const StormByte::Safe::Optional< StormByte::ByteSize > & MaxMemory() const noexcept
Cache cap when the caller set it.
Definition parameters.hxx:488
const StormByte::Safe::Optional< StormByte::ByteSize > & ReadChunk() const noexcept
Origin request maximum when the caller supplied it.
Definition parameters.hxx:472
Ring unit and drain trigger.
Definition parameters.hxx:360
StormByte::ByteSize Value() const noexcept
Chunk size.
Definition parameters.hxx:373
WriteChunk(const StormByte::ByteSize value) noexcept
Store the chunk size.
Definition parameters.hxx:366
Page drain high watermark.
Definition parameters.hxx:182
StormByte::ByteSize Value() const noexcept
Requested high watermark.
Definition parameters.hxx:225
WriteThreshold(WriteThreshold &&other) noexcept=default
Move the watermark.
WriteThreshold(const WriteThreshold &other) noexcept=default
Copy the watermark.
WriteThreshold(StormByte::ByteSize value) noexcept
Store the drain high watermark.
Definition parameters.hxx:188
~WriteThreshold() noexcept=default
Destroy the non-owning watermark.
Maximum OriginPush request in every mode.
Definition parameters.hxx:130
StormByte::ByteSize Value() const noexcept
Requested transfer maximum.
Definition parameters.hxx:173
~WriteTransfer() noexcept=default
Destroy the non-owning limit.
WriteTransfer(WriteTransfer &&other) noexcept=default
Move the limit.
WriteTransfer(const WriteTransfer &other) noexcept=default
Copy the limit.
WriteTransfer(StormByte::ByteSize value) noexcept
Store the transfer maximum.
Definition parameters.hxx:136
Optional writer knobs.
Definition parameters.hxx:563
const StormByte::Safe::Optional< StormByte::ByteSize > & MaxMemory() const noexcept
Dirty-page budget when the caller set it.
Definition parameters.hxx:647
WriterParameters(const WriterParameters &other)=default
Copy Safe-owned optional knobs; may allocate and throw.
const StormByte::Safe::Optional< StormByte::ByteSize > & WriteChunk() const noexcept
Chunk size when the caller set it.
Definition parameters.hxx:631
WriterParameters(Knobs... knobs)
Engage the listed knobs.
Definition parameters.hxx:576
WriterParameters()=default
No knobs.
WriterParameters(WriterParameters &&other) noexcept=default
Transfer Safe-owned optional knobs.
~WriterParameters() noexcept=default
Release optional knobs through provider callbacks.
const StormByte::Safe::Optional< StormByte::ByteSize > & WriteTransfer() const noexcept
Universal push maximum when the caller supplied it.
Definition parameters.hxx:615
const StormByte::Safe::Optional< std::size_t > & BackPressure() const noexcept
Backpressure when the caller set it.
Definition parameters.hxx:639
const StormByte::Safe::Optional< StormByte::ByteSize > & WriteThreshold() const noexcept
Page-drain watermark when the caller supplied it.
Definition parameters.hxx:623
const StormByte::Safe::Optional< std::chrono::milliseconds::rep > & MaxWait() const noexcept
Signed millisecond count when the caller set the wait cap.
Definition parameters.hxx:655
STORMBYTE_DECLARE_MAYBE_SAFE(class StormByte::System::Device::Access)
Buffered binary sources and sinks.
Buffer module of the StormByte suite.
Root namespace of the StormByte C++ suite.
Complete non-owning reader policy; scalar time crosses the DLL.
Definition parameters.hxx:234
StormByte::ByteSize ReadAhead
Prefetch target; zero disables.
Definition parameters.hxx:236
StormByte::ByteSize ReadChunk
Origin request maximum; zero selects 64 KiB.
Definition parameters.hxx:235
std::int64_t MaxWaitMilliseconds
Wait cap; zero is unlimited.
Definition parameters.hxx:238
StormByte::ByteSize MaxMemory
Page payload budget.
Definition parameters.hxx:237
Non-I/O snapshot.
Definition parameters.hxx:256
StormByte::ByteSize Bytes
Lifetime origin bytes.
Definition parameters.hxx:258
StormByte::ByteSize MaxRequest
Lifetime maximum request.
Definition parameters.hxx:260
StormByte::ByteSize LastRequest
Last hook request size.
Definition parameters.hxx:259
StormByte::ByteSize TransferLimit
Effective maximum; zero means unlimited.
Definition parameters.hxx:261
StormByte::ByteSize InFlight
Bytes requested in a current hook.
Definition parameters.hxx:267
StormByte::ByteSize Retained
Nonseekable reader replay outside pages.
Definition parameters.hxx:268
StormByte::ByteSize Pending
Queued/in-materialization payload.
Definition parameters.hxx:266
StormByte::ByteSize QueueCapacity
Logical ring admission capacity.
Definition parameters.hxx:264
StormByte::ByteSize RingCapacity
Actual ring allocation.
Definition parameters.hxx:263
StormByte::ByteSize Reconfiguration
Temporary replacement ring reservation.
Definition parameters.hxx:269
StormByte::ByteSize Threshold
Effective page drain watermark.
Definition parameters.hxx:265
std::size_t Calls
Lifetime real hook calls.
Definition parameters.hxx:257
StormByte::ByteSize PageCapacity
Page payload budget.
Definition parameters.hxx:262
Complete non-owning writer policy; Configure applies all fields together.
Definition parameters.hxx:244
std::int64_t MaxWaitMilliseconds
Wait cap; zero is unlimited.
Definition parameters.hxx:247
StormByte::ByteSize WriteChunk
Ring unit and drain trigger.
Definition parameters.hxx:245
std::size_t BackPressure
Ring capacity in chunk units.
Definition parameters.hxx:246
StormByte::ByteSize WriteThreshold
Drain high watermark; zero is pressure only.
Definition parameters.hxx:250
StormByte::ByteSize MaxMemory
Dirty page payload budget.
Definition parameters.hxx:248
StormByte::ByteSize WriteTransfer
Universal push maximum; zero is unlimited.
Definition parameters.hxx:249