#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.
Pothos::BufferAccumulator::BufferAccumulator |
( |
void |
| ) |
|
Create a new buffer accumulator.
bool Pothos::BufferAccumulator::empty |
( |
void |
| ) |
const |
|
inline |
Is the accumulator empty?
- Returns
- true when zero bytes available
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
size_t Pothos::BufferAccumulator::getTotalBytesAvailable |
( |
void |
| ) |
const |
|
inline |
Get the total number of bytes held in this accumulator.
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.
void Pothos::BufferAccumulator::pop |
( |
const size_t |
numBytes | ) |
|
Pop numBytes from the front of this accumulator.
- Parameters
-
numBytes | the number of bytes to remove |
void Pothos::BufferAccumulator::push |
( |
const BufferChunk & |
buffer | ) |
|
Push a buffer chunk into the accumulator.
- Parameters
-
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: