Shared logical byte accounting for queues and concurrent work.
More...
#include <StormByte/buffer/byte_budget.hxx>
|
| class | Lease |
| | Shared charge that can explicitly follow one payload across queues or work. More...
|
Shared logical byte accounting for queues and concurrent work.
Copies share provider-owned state. A lease is charged once until its final copy is released. Buffer and Base must remain loaded. Independent handles may be used concurrently; do not move/assign a handle in use.
◆ ByteBudget() [1/5]
| StormByte::Buffer::ByteBudget::ByteBudget |
( |
| ) |
|
|
inline |
Construct an unlimited aggregate budget.
◆ ByteBudget() [2/5]
Explicitly construct an unlimited budget.
◆ ByteBudget() [3/5]
Construct a fixed aggregate ceiling; zero allows only zero-byte charges.
- Parameters
-
| limit | Aggregate logical bytes. |
◆ ByteBudget() [4/5]
| StormByte::Buffer::ByteBudget::ByteBudget |
( |
const ByteBudget & | other | ) |
|
|
defaultnoexcept |
Share budget identity and counters.
- Parameters
-
◆ ByteBudget() [5/5]
| StormByte::Buffer::ByteBudget::ByteBudget |
( |
ByteBudget && | other | ) |
|
|
defaultnoexcept |
Transfer a budget handle.
- Parameters
-
| other | Source, left invalid. |
◆ ~ByteBudget()
| StormByte::Buffer::ByteBudget::~ByteBudget |
( |
| ) |
|
|
defaultnoexcept |
Release this handle without closing other handles or leases.
◆ CancelPending()
| void StormByte::Buffer::ByteBudget::CancelPending |
( |
| ) |
const |
|
noexcept |
Cancel currently waiting admissions without closing or invalidating leases.
◆ Close()
| void StormByte::Buffer::ByteBudget::Close |
( |
| ) |
const |
|
noexcept |
Reject future reservations and wake waiters, retaining existing charges.
◆ operator=() [1/2]
Transfer another budget handle.
- Parameters
-
| other | Source, left invalid. |
- Returns
- This handle.
◆ operator=() [2/2]
Share another budget.
- Parameters
-
- Returns
- This handle.
◆ ReserveFor()
Reserve with a bounded wait; zero attempts immediately.
- Parameters
-
| bytes | Caller-defined weight. |
| output | Replaced only on success. |
| timeout | Nonnegative wait duration. |
- Returns
- Admission result; oversize weights fail without waiting.
◆ SharesIdentity()
| bool StormByte::Buffer::ByteBudget::SharesIdentity |
( |
const ByteBudget & | other | ) |
const |
|
noexcept |
Compare shared provider state without reserving or locking.
Works before and after Close. Independent budgets differ even with equal limits and counters; moved-from handles share nothing, even together. Concurrent comparison is safe unless a handle is moved or assigned.
- Parameters
-
- Returns
- True when both valid handles share one internal state.
◆ Snapshot()
Read counters under a short state lock, without capacity waits or I/O.
- Returns
- Coherent aggregate accounting.
◆ TryReserve()
Reserve without waiting for capacity.
- Parameters
-
| bytes | Caller-defined weight. |
| output | Replaced only on success. |
- Returns
- Explicit admission result; allocation failure rolls back the charge.
◆ Detail::BudgetAccess
The documentation for this class was generated from the following file: