Class QueueBuffer

Class Documentation

class QueueBuffer

Queue buffer implementation.

Basic queue buffer implementation

Template Parameters:

Type – of the buffer elements

Public Functions

inline QueueBuffer()

Contructor

template<class T>
inline void initQueueBuffer(size_t bufferSize)

Buffer Memory Allocation

Parameters:

bufferSize – Number of elements of the buffer

inline ~QueueBuffer()

Destructor

inline void freeQueueBuffer()

Deallocate Buffer memory

QueueBuffer(QueueBuffer const &x) = delete

Disable copy constructor

Parameters:

x – &#8212;

void operator=(QueueBuffer const &x) = delete

Disable copy assignment

Parameters:

x – &#8212;

inline void insertBlock(const void *newBlockPtr, size_t blockSize)

Move the data of buffer and copy a new block data by the end.

Parameters:
  • newBlockPtr – Pointer to the data to copy

  • blockSize – Size of the block (bytes)

inline void insertZeroBlock(size_t blockSize)

Move the data of buffer and copy a new zero block data by the end.

Parameters:

blockSize – Size of the block (bytes)

inline void removeBlock(size_t blockSize)

Remove data from buffer

Parameters:

blockSize – Size of the block (bytes)

inline size_t getFilledSize() const

Returns filled buffer size (elements)

Returns:

Buffer size

inline size_t getBufferSize() const

Returns total buffer size (elements)

Returns:

Buffer size

inline void *getBufferPtr() const

Returns the pointer to the raw data

Returns:

Pointer to raw data