StormByte-Buffer 4.0.0
C++26 buffer module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Buffer::QueueLimits Class Reference

Independent local bounds; absent means unlimited, engaged zero means zero capacity. More...

#include <StormByte/buffer/byte_budget.hxx>

Public Member Functions

STORMBYTE_FORCE_INLINE QueueLimits (StormByte::Safe::Optional< StormByte::Size > elements={}, StormByte::Safe::Optional< StormByte::ByteSize > bytes={}) noexcept
 Resolve optional limits into a non-owning value.
 QueueLimits (const QueueLimits &other) noexcept=default
 Copy resolved bounds without allocation.
 QueueLimits (QueueLimits &&other) noexcept=default
 Move resolved bounds without ownership.
 ~QueueLimits () noexcept=default
 Destroy non-owning bounds.
QueueLimits & operator= (const QueueLimits &other) noexcept=default
 Replace resolved bounds without allocation.
QueueLimits & operator= (QueueLimits &&other) noexcept=default
 Move-assign resolved bounds.
constexpr bool ElementsLimited () const noexcept
 Whether an item ceiling is configured.
constexpr bool BytesLimited () const noexcept
 Whether a byte ceiling is configured.
constexpr StormByte::Size Elements () const noexcept
 Configured item ceiling.
constexpr void Elements (StormByte::Size elements) noexcept
 Engage an item ceiling without allocating an optional.
constexpr void UnlimitedElements () noexcept
 Remove only the item ceiling without changing byte limits.
constexpr StormByte::ByteSize Bytes () const noexcept
 Configured byte ceiling.

Detailed Description

Independent local bounds; absent means unlimited, engaged zero means zero capacity.

Constructor & Destructor Documentation

◆ QueueLimits() [1/3]

STORMBYTE_FORCE_INLINE StormByte::Buffer::QueueLimits::QueueLimits ( StormByte::Safe::Optional< StormByte::Size > elements = {},
StormByte::Safe::Optional< StormByte::ByteSize > bytes = {} )
inlinenoexcept

Resolve optional limits into a non-owning value.

Parameters
elementsOptional item ceiling.
bytesOptional logical-byte ceiling.

◆ QueueLimits() [2/3]

StormByte::Buffer::QueueLimits::QueueLimits ( const QueueLimits & other)
defaultnoexcept

Copy resolved bounds without allocation.

Parameters
otherSource.

◆ QueueLimits() [3/3]

StormByte::Buffer::QueueLimits::QueueLimits ( QueueLimits && other)
defaultnoexcept

Move resolved bounds without ownership.

Parameters
otherSource.

◆ ~QueueLimits()

StormByte::Buffer::QueueLimits::~QueueLimits ( )
defaultnoexcept

Destroy non-owning bounds.

Member Function Documentation

◆ Bytes()

StormByte::ByteSize StormByte::Buffer::QueueLimits::Bytes ( ) const
inlineconstexprnoexcept

Configured byte ceiling.

Returns
Bytes; meaningful only when BytesLimited is true.

◆ BytesLimited()

bool StormByte::Buffer::QueueLimits::BytesLimited ( ) const
inlineconstexprnoexcept

Whether a byte ceiling is configured.

Returns
True for an engaged byte limit.

◆ Elements() [1/2]

StormByte::Size StormByte::Buffer::QueueLimits::Elements ( ) const
inlineconstexprnoexcept

Configured item ceiling.

Returns
Items; meaningful only when ElementsLimited is true.

◆ Elements() [2/2]

void StormByte::Buffer::QueueLimits::Elements ( StormByte::Size elements)
inlineconstexprnoexcept

Engage an item ceiling without allocating an optional.

Parameters
elementsItem ceiling, including an explicit zero.

◆ ElementsLimited()

bool StormByte::Buffer::QueueLimits::ElementsLimited ( ) const
inlineconstexprnoexcept

Whether an item ceiling is configured.

Returns
True for an engaged element limit.

◆ operator=() [1/2]

QueueLimits & StormByte::Buffer::QueueLimits::operator= ( const QueueLimits & other)
defaultnoexcept

Replace resolved bounds without allocation.

Parameters
otherSource.
Returns
This value.

◆ operator=() [2/2]

QueueLimits & StormByte::Buffer::QueueLimits::operator= ( QueueLimits && other)
defaultnoexcept

Move-assign resolved bounds.

Parameters
otherSource.
Returns
This value.

◆ UnlimitedElements()

void StormByte::Buffer::QueueLimits::UnlimitedElements ( )
inlineconstexprnoexcept

Remove only the item ceiling without changing byte limits.


The documentation for this class was generated from the following file: