Click
Loading...
Searching...
No Matches
Public Member Functions | List of all members
BufferPoolNode Class Reference

Class used to manage a buffer obtained via a BufferPool. More...

#include <bufferpoolnode.hh>

Public Member Functions

 BufferPoolNode (uint32_t initialSize)
 Construct a BufferPoolNode.
 
 ~BufferPoolNode ()
 Destruct a BufferPoolNode.
 
unsigned char * getBuffer ()
 Return the actual buffer (the area of memory). Note that the size of the buffer is random, so be sure to resize it to fit your needs.
 
uint32_t getSize () const
 Return the size of the buffer.
 
void resize (uint32_t newSize)
 Resize the buffer. This operation is efficient if the capacity of the buffer is greater than the requested size. The capacity of the buffer depends on its previous sizes.
 

Detailed Description

Class used to manage a buffer obtained via a BufferPool.

BufferPool returns a pointer to a BufferPoolNode that is used to manage the buffer and perform operations such as resize the buffer.

Constructor & Destructor Documentation

◆ BufferPoolNode()

BufferPoolNode::BufferPoolNode ( uint32_t  initialSize)

Construct a BufferPoolNode.

Parameters
initialSizeThe initial size of the buffer

◆ ~BufferPoolNode()

BufferPoolNode::~BufferPoolNode ( )

Destruct a BufferPoolNode.

Member Function Documentation

◆ getBuffer()

unsigned char * BufferPoolNode::getBuffer ( )

Return the actual buffer (the area of memory). Note that the size of the buffer is random, so be sure to resize it to fit your needs.

Returns
A pointer to the buffer managed by this BufferPoolNode

◆ getSize()

uint32_t BufferPoolNode::getSize ( ) const

Return the size of the buffer.

Returns
The size of the buffer

◆ resize()

void BufferPoolNode::resize ( uint32_t  newSize)

Resize the buffer. This operation is efficient if the capacity of the buffer is greater than the requested size. The capacity of the buffer depends on its previous sizes.

Parameters
newSizeThe new size of the buffer. If the buffer grows, the new memory will be set to 0.

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