Pothos  0.3.3-g32d3017c
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
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...
 
bool empty (void) const
 
void push (const 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

Pothos::BufferAccumulator::BufferAccumulator ( void  )

Create a new buffer accumulator.

Member Function Documentation

bool Pothos::BufferAccumulator::empty ( void  ) const
inline

Is the accumulator empty?

Returns
true when zero bytes available
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
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
numBytesthe number of bytes to remove
void Pothos::BufferAccumulator::push ( const BufferChunk buffer)

Push a buffer chunk into the accumulator.

Parameters
buffera buffer chunk
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: