9#ifndef MIDDLEBOX_CIRCULARBUFFER_HH
10#define MIDDLEBOX_CIRCULARBUFFER_HH
13#include <click/bufferpool.hh>
14#include <click/bufferpoolnode.hh>
75 void addDataAtEnd(
const unsigned char* data, uint32_t length);
98 void increaseBufferSize(uint32_t addSize);
Class used to provide a pool of buffers that can have a dynamic size and be resized at any moment.
Definition bufferpool.hh:25
Class used to manage a buffer obtained via a BufferPool.
Definition bufferpoolnode.hh:21
Represents a ring buffer that automatically grows to be able to store the data and provides O(1) oper...
Definition circularbuffer.hh:24
uint32_t getSize()
Return the size of the circular buffer (the size of the data in it)
Definition circularbuffer.cc:65
void addDataAtEnd(const unsigned char *data, uint32_t length)
Add data at the end of the buffer.
Definition circularbuffer.cc:101
void getData(uint32_t start, uint32_t length, Vector< unsigned char > &getBuffer)
Retrieve data from the buffer.
Definition circularbuffer.cc:160
void setStartOffset(uint32_t startOffset)
Set the start offset. Offset of the first byte in the buffer. Used to be able to manipulate sequence ...
Definition circularbuffer.cc:143
uint32_t getStartOffset()
Return the start offset. Offset of the first byte in the buffer. Used to be able to manipulate sequen...
Definition circularbuffer.cc:149
uint32_t getCapacity()
Return the capacity of the circular buffer (the size of the memory chunk it uses)
Definition circularbuffer.cc:70
~CircularBuffer()
Destruct a CircularBuffer Put the buffer back into the BufferPool.
Definition circularbuffer.cc:29
void removeDataAtBeginning(uint32_t newStart)
Remove data at the beginning of the buffer.
Definition circularbuffer.cc:75
bool isBlank()
Indicate whether the buffer is blank.
Definition circularbuffer.cc:154
Vector template.
Definition vector.hh:111
Click's vector container template.