A smart buffer has a shared pointer to the memory buffer and an offset and size of a 'smart' sub buffer.
More...
Detailed Description
A smart buffer has a shared pointer to the memory buffer and an offset and size of a 'smart' sub buffer.
Constructor & Destructor Documentation
| MAKLogger::DtSmartBuffer::DtSmartBuffer |
( |
const DtMemoryBufferSP & |
parentBuffer | ) |
|
|
explicit |
Creates a smart sub buffer, that is maps directly to a single DtSmartBuffer.
Initializes offset to beginning of buffer and size to size of entire buffer.
- Exceptions
-
| DtInvalid | input if the buffer is null. |
| MAKLogger::DtSmartBuffer::DtSmartBuffer |
( |
const DtMemoryBufferSP & |
parentBuffer, |
|
|
size_t |
offset, |
|
|
size_t |
size |
|
) |
| |
CTOR which uses shared parent buffer.
- Exceptions
-
| DtInvalidInput | when the offset is too large. |
| MAKLogger::DtSmartBuffer::~DtSmartBuffer |
( |
| ) |
|
Member Function Documentation
| size_t MAKLogger::DtSmartBuffer::availableSize |
( |
| ) |
const |
Get the available size left in the memory buffer.
This will be >= to size
Get the memory buffer the smart buffer uses.
| size_t MAKLogger::DtSmartBuffer::currentOffset |
( |
| ) |
const |
Get the current offset from the base memory.
| void* MAKLogger::DtSmartBuffer::data |
( |
| ) |
|
Get the data in the smart buffer.
| const void* MAKLogger::DtSmartBuffer::data |
( |
| ) |
const |
Get the const data in the smart buffer.
| void MAKLogger::DtSmartBuffer::increaseOffset |
( |
int |
offsetInBytes | ) |
|
Increase the offset in the memory buffer.
- Exceptions
-
| DtInvalidInput | when the offset is too large. |
| void MAKLogger::DtSmartBuffer::resetOffset |
( |
| ) |
|
Reset the offset to the beginning of the memory buffer.
| void MAKLogger::DtSmartBuffer::resize |
( |
size_t |
| ) |
|
Set the size of the smart buffer.
- Warning
- This does not change the amount of memory allocated.
- Exceptions
-
| DtInvalidInput | when the offset is larger than the memory buffer or less than zero. |
Set the memory buffer the smart buffer uses.
This call initializes offset to beginning of buffer and size to size of entire buffer.
- Exceptions
-
| DtInvalid | input if the buffer is null. |
| void MAKLogger::DtSmartBuffer::setOffset |
( |
int |
offsetInBytes | ) |
|
Set the offset from the beginning of the memory buffer.
- Exceptions
-
| DtInvalidInput | when the offset is too large. |
| size_t MAKLogger::DtSmartBuffer::size |
( |
| ) |
const |
Get the size of the smart buffer.
Member Data Documentation
| size_t MAKLogger::DtSmartBuffer::mySize |
|
private |
| void* MAKLogger::DtSmartBuffer::mySubData |
|
private |
The documentation for this class was generated from the following file: