#include <ccommbufferbase.h>
Adds buffer (re)allocation functions to cCommBuffer. This functionality is not always needed, as some libraries manage their pack/unpack buffers internally.
◆ cCommBufferBase()
◆ ~cCommBufferBase()
◆ getBuffer()
char* getBuffer |
( |
| ) |
const |
Returns the buffer after packing.
◆ getBufferLength()
int getBufferLength |
( |
| ) |
const |
Returns the size of the buffer.
◆ allocateAtLeast()
void allocateAtLeast |
( |
int |
size | ) |
|
Extend buffer to the given size is needed. Existing buffer contents may be lost.
◆ setMessageSize()
void setMessageSize |
( |
int |
size | ) |
|
Set message length in the buffer. Used after receiving a message and copying it to the buffer.
◆ getMessageSize()
int getMessageSize |
( |
| ) |
const |
Returns message length in the buffer.
◆ reset()
Reset buffer to an empty state.
◆ isBufferEmpty()
virtual bool isBufferEmpty |
( |
| ) |
const |
|
overridevirtual |
Returns true if all data in buffer was used up during unpacking. Returns false if there was underflow (too much data unpacked) or still there are unpacked data in the buffer.
Implements cCommBuffer.
◆ assertBufferEmpty()
virtual void assertBufferEmpty |
( |
| ) |
|
|
overridevirtual |
Utility function. To be called after unpacking a communication buffer, it checks whether the buffer is empty. If it is not (i.e. an underflow or overflow occurred), an exception is thrown.
Implements cCommBuffer.
◆ swap()
Utility method: swap the contents of the two buffers
The documentation for this class was generated from the following file: