std::vector-like growing array for byte storage.
#include <AUI/Common/AByteBuffer.h>
> All members, including inherited
◆ at() [1/2]
template<typename T>
T & AByteBuffer::at |
( |
size_t | byteIndex | ) |
|
|
inline |
- Template Parameters
-
- Parameters
-
byteIndex | byte offset realtive to the beginning of internal buffer |
- Returns
- data
◆ at() [2/2]
template<typename T>
const T & AByteBuffer::at |
( |
size_t | byteIndex | ) |
const |
|
inline |
- Template Parameters
-
- Parameters
-
byteIndex | byte offset realtive to the beginning of internal buffer |
- Returns
- data
◆ capacity()
size_t AByteBuffer::capacity |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- size of whole buffer (including possibly invalid data)
◆ data()
char * AByteBuffer::data |
( |
| ) |
const |
|
inline |
◆ empty()
bool AByteBuffer::empty |
( |
| ) |
const |
|
inlinenoexcept |
◆ getAvailableToWrite()
size_t AByteBuffer::getAvailableToWrite |
( |
| ) |
const |
|
inline |
- Returns
- delta between internal buffer size and payload size.
◆ getReserved()
size_t AByteBuffer::getReserved |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- size of internal buffer. Must be greater that getSize()
◆ getSize()
size_t AByteBuffer::getSize |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- size of payload (valid data)
◆ increaseSize()
void AByteBuffer::increaseSize |
( |
size_t | s | ) |
|
|
inline |
Forces new size of the buffer.
- Sneaky assert:
- Assert fails when new size is greater that reserved buffer size. Use
AByteBuffer::resize
to avoid this.
- Parameters
-
◆ reallocate()
void AByteBuffer::reallocate |
( |
size_t | s | ) |
|
|
inline |
Resizes the buffer WITHOUT keeping it's contents. When reserved buffer size is differs from the new size, buffer is reallocated with new size.
- Parameters
-
◆ resize()
void AByteBuffer::resize |
( |
size_t | s | ) |
|
|
inline |
Resizes the buffer keeping it's contents. When reserved buffer size is less than the new size, buffer is reallocated with new size.
- Parameters
-
◆ setSize()
void AByteBuffer::setSize |
( |
size_t | s | ) |
|
|
inline |
Forces new size of the buffer.
- Sneaky assert:
- Assert fails when new size is greater that reserved buffer size. Use
AByteBuffer::resize
to avoid this.
- Parameters
-
◆ size()
size_t AByteBuffer::size |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- size of payload (valid data)
◆ write() [1/2]
void AByteBuffer::write |
( |
const char * | src, |
|
|
size_t | size ) |
|
overridevirtual |
- Sneaky exceptions
- An implementation can throw any exception that subclasses AIOException.
- Parameters
-
src | source buffer |
size | source buffer's size. > 0 |
Implements IOutputStream.
◆ write() [2/2]
void AByteBuffer::write |
( |
IInputStream & | stream, |
|
|
size_t | size ) |
Reads exact size
bytes from stream
.
- Parameters
-