|
Click
|
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. | |
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.
| BufferPoolNode::BufferPoolNode | ( | uint32_t | initialSize | ) |
Construct a BufferPoolNode.
| initialSize | The initial size of the buffer |
| BufferPoolNode::~BufferPoolNode | ( | ) |
Destruct a BufferPoolNode.
| 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.
| uint32_t BufferPoolNode::getSize | ( | ) | const |
Return the size of the buffer.
| 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.
| newSize | The new size of the buffer. If the buffer grows, the new memory will be set to 0. |