MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
MAKLogger::DtSmartBuffer Class Reference

A smart buffer has a shared pointer to the memory buffer and an offset and size of a 'smart' sub buffer. More...

+ Collaboration diagram for MAKLogger::DtSmartBuffer:

Public Member Functions

 DtSmartBuffer (const DtMemoryBufferSP &parentBuffer)
 Creates a smart sub buffer, that is maps directly to a single DtSmartBuffer. More...
 
 DtSmartBuffer (const DtMemoryBufferSP &parentBuffer, size_t offset, size_t size)
 CTOR which uses shared parent buffer. More...
 
 ~DtSmartBuffer ()
 DTOR More...
 
DtMemoryBufferSP buffer () const
 Get the memory buffer the smart buffer uses. More...
 
void setBuffer (const DtMemoryBufferSP &buffer)
 Set the memory buffer the smart buffer uses. More...
 
void * data ()
 Get the data in the smart buffer. More...
 
const void * data () const
 Get the const data in the smart buffer. More...
 
size_t size () const
 Get the size of the smart buffer. More...
 
void resize (size_t)
 Set the size of the smart buffer. More...
 
size_t availableSize () const
 Get the available size left in the memory buffer. More...
 
size_t currentOffset () const
 Get the current offset from the base memory. More...
 
void increaseOffset (int offsetInBytes)
 Increase the offset in the memory buffer. More...
 
void setOffset (int offsetInBytes)
 Set the offset from the beginning of the memory buffer. More...
 
void resetOffset ()
 Reset the offset to the beginning of the memory buffer. More...
 

Private Attributes

DtMemoryBufferSP myBuffer
 
void * mySubData
 
size_t mySize
 

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
DtInvalidinput if the buffer is null.
MAKLogger::DtSmartBuffer::DtSmartBuffer ( const DtMemoryBufferSP parentBuffer,
size_t  offset,
size_t  size 
)

CTOR which uses shared parent buffer.

Exceptions
DtInvalidInputwhen the offset is too large.
MAKLogger::DtSmartBuffer::~DtSmartBuffer ( )

DTOR

Member Function Documentation

size_t MAKLogger::DtSmartBuffer::availableSize ( ) const

Get the available size left in the memory buffer.

This will be >= to size

DtMemoryBufferSP MAKLogger::DtSmartBuffer::buffer ( ) const

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
DtInvalidInputwhen 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
DtInvalidInputwhen the offset is larger than the memory buffer or less than zero.
void MAKLogger::DtSmartBuffer::setBuffer ( const DtMemoryBufferSP buffer)

Set the memory buffer the smart buffer uses.

This call initializes offset to beginning of buffer and size to size of entire buffer.

Exceptions
DtInvalidinput if the buffer is null.
void MAKLogger::DtSmartBuffer::setOffset ( int  offsetInBytes)

Set the offset from the beginning of the memory buffer.

Exceptions
DtInvalidInputwhen the offset is too large.
size_t MAKLogger::DtSmartBuffer::size ( ) const

Get the size of the smart buffer.

Member Data Documentation

DtMemoryBufferSP MAKLogger::DtSmartBuffer::myBuffer
private
size_t MAKLogger::DtSmartBuffer::mySize
private
void* MAKLogger::DtSmartBuffer::mySubData
private

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

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)