#include <BufferAccumulator.hpp>
The BufferAccumulator is a queue like interface for holding and interacting with buffer chunks.
A BufferAccumulator enqueus input buffers and presents contiguous buffer chunks to the caller when applicable. The BufferAccumulator may do several things:
- Forward the same input buffers to the caller.
- Amalgamate contiguous buffers into one.
- Memcpy when the caller requires contiguity.
◆ BufferAccumulator()
Pothos::BufferAccumulator::BufferAccumulator |
( |
void |
| ) |
|
Create a new buffer accumulator.
◆ clear()
void Pothos::BufferAccumulator::clear |
( |
void |
| ) |
|
Clear the contents of this buffer accumulator.
◆ empty()
bool Pothos::BufferAccumulator::empty |
( |
void |
| ) |
const |
|
inline |
Is the accumulator empty?
- Returns
- true when zero bytes available
◆ front()
Get the front buffer. This reference is invalidated after mutator calls. When empty, front returns an empty buffer.
- Returns
- a const reference to the front buffer
◆ getTotalBytesAvailable()
size_t Pothos::BufferAccumulator::getTotalBytesAvailable |
( |
void |
| ) |
const |
|
inline |
Get the total number of bytes held in this accumulator.
◆ getUniqueManagedBufferCount()
size_t Pothos::BufferAccumulator::getUniqueManagedBufferCount |
( |
void |
| ) |
const |
How many unique managed buffers are enqueued in this accumulator?
- Warning
- expensive: this method is for debug/stats purposes.
◆ pop()
void Pothos::BufferAccumulator::pop |
( |
const size_t |
numBytes | ) |
|
Pop numBytes from the front of this accumulator.
- Parameters
-
numBytes | the number of bytes to remove |
◆ push()
void Pothos::BufferAccumulator::push |
( |
BufferChunk && |
buffer | ) |
|
Push a buffer chunk into the accumulator.
- Parameters
-
◆ require()
void Pothos::BufferAccumulator::require |
( |
const size_t |
numBytes | ) |
|
Enforce a requirement on the front buffer size. If the front buffer is less than numBytes, several buffers will be copied together into a larger buffer with at least numBytes. The effect of this call is over after pop().
- Parameters
-
numBytes | the number of bytes needed |
The documentation for this class was generated from the following file: