Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
Public Member Functions | List of all members
Pothos::BufferAccumulator Class Reference

#include <BufferAccumulator.hpp>

Public Member Functions

 BufferAccumulator (void)
 Create a new buffer accumulator. More...
 
void clear (void)
 Clear the contents of this buffer accumulator. More...
 
bool empty (void) const
 
void push (BufferChunk &&buffer)
 
const BufferChunkfront (void) const
 
void pop (const size_t numBytes)
 
size_t getTotalBytesAvailable (void) const
 Get the total number of bytes held in this accumulator. More...
 
void require (const size_t numBytes)
 
size_t getUniqueManagedBufferCount (void) const
 

Detailed Description

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:

Constructor & Destructor Documentation

◆ BufferAccumulator()

Pothos::BufferAccumulator::BufferAccumulator ( void  )

Create a new buffer accumulator.

Member Function Documentation

◆ 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()

const Pothos::BufferChunk & Pothos::BufferAccumulator::front ( void  ) const
inline

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
numBytesthe number of bytes to remove

◆ push()

void Pothos::BufferAccumulator::push ( BufferChunk &&  buffer)

Push a buffer chunk into the accumulator.

Parameters
buffera buffer chunk

◆ 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
numBytesthe number of bytes needed

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