prf::pr::afsk::BitBuffer class final

Fixed-size ring buffer for recovered modem bits.

The implementation stores bits packed into bytes and performs no dynamic allocation. It is intended for steady-state embedded paths where heap use is forbidden.

Public static variables

static std::size_t kCapacityBits constexpr
Maximum number of bits that can be queued.
static std::size_t kCapacityBytes constexpr
Internal packed storage size in bytes.

Public functions

void clear()
Clear all queued bits and reset cursor state.
auto pop(bool* out_bit) -> bool
Pop one bit from the queue head.
auto push(bool bit) -> bool
Push one recovered bit to the queue tail.
auto size() const -> std::size_t
Query the current queued bit count.

Function documentation

bool prf::pr::afsk::BitBuffer::pop(bool* out_bit)

Pop one bit from the queue head.

Parameters
out_bit out Destination for the popped bit.
Returns true on success, false if queue is empty or output pointer is null.

bool prf::pr::afsk::BitBuffer::push(bool bit)

Push one recovered bit to the queue tail.

Parameters
bit Bit value to enqueue.
Returns true if enqueued, false if the queue is full.