iDRS™ SDK 16
Loading...
Searching...
No Matches
CMemoryBuffer_interface.h File Reference

Interface for CMemoryBuffer wrapper. More...

Go to the source code of this file.

Functions

CMemoryBuffer CMemoryBuffer_Create (IDRS_UINT const uiInitialMemoryBufferSize, idrs_exception *pargException)
 The Create method creates a memory buffer object.
 
CMemoryBuffer CMemoryBuffer_Create2 (idrs_exception *pargException)
 The Create method creates a memory buffer object.
 
CMemoryBuffer CMemoryBuffer_Create3 (IDRS_PVOID const pvData, IDRS_UINT const uiDataSize, idrs_exception *pargException)
 Creates a memory buffer object holding the provided data.
 
void CMemoryBuffer_Allocate (CMemoryBuffer argCMemoryBuffer, IDRS_UINT const uiMemSize, idrs_exception *pargException)
 Allocate reallocates the memory buffer.
 
void CMemoryBuffer_Resize (CMemoryBuffer argCMemoryBuffer, IDRS_UINT64 const uiMemorySize64, idrs_exception *pargException)
 Resizes the underlying memory buffer.
 
void CMemoryBuffer_ReserveCapacity (CMemoryBuffer argCMemoryBuffer, IDRS_UINT64 const uiMemorySize64, idrs_exception *pargException)
 Reserves memory for the underlying memory buffer.
 
IDRS_UINT CMemoryBuffer_GetSize (const CMemoryBuffer argCMemoryBuffer, idrs_exception *pargException)
 GetSize returns the number of bytes allocated through Resize.
 
IDRS_UINT64 CMemoryBuffer_GetReservedCapacity (const CMemoryBuffer argCMemoryBuffer, idrs_exception *pargException)
 GetReserved returns the number of bytes allocated.
 
IDRS_PVOID CMemoryBuffer_GetData (const CMemoryBuffer argCMemoryBuffer, idrs_exception *pargException)
 GetData returns the memory data.
 
void CMemoryBuffer_Destroy (CMemoryBuffer argCMemoryBuffer, idrs_exception *pargException)
 Destroys a CMemoryBuffer handle.
 

Detailed Description

Interface for CMemoryBuffer wrapper.

Function Documentation

◆ CMemoryBuffer_Allocate()

void CMemoryBuffer_Allocate ( CMemoryBuffer  argCMemoryBuffer,
IDRS_UINT const  uiMemSize,
idrs_exception *  pargException 
)

Allocate reallocates the memory buffer.

The size of the memory buffer may be increase or decreased.

Parameters
argCMemoryBufferCMemoryBuffer handle
uiMemSizeThe size of memory needed.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryBuffer_Create()

CMemoryBuffer CMemoryBuffer_Create ( IDRS_UINT const  uiInitialMemoryBufferSize,
idrs_exception *  pargException 
)

The Create method creates a memory buffer object.

Parameters
uiInitialMemoryBufferSizeThe initial memory buffer size.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The newly created memory buffer.

◆ CMemoryBuffer_Create2()

CMemoryBuffer CMemoryBuffer_Create2 ( idrs_exception *  pargException)

The Create method creates a memory buffer object.

Parameters
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The newly created memory buffer.

◆ CMemoryBuffer_Create3()

CMemoryBuffer CMemoryBuffer_Create3 ( IDRS_PVOID const  pvData,
IDRS_UINT const  uiDataSize,
idrs_exception *  pargException 
)

Creates a memory buffer object holding the provided data.

Parameters
pvDataThe data to hold in the buffer.
uiDataSizeThe size of the data
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The newly created memory buffer.
Remarks
The data buffer will be copied internally in the memory buffer.

◆ CMemoryBuffer_Destroy()

void CMemoryBuffer_Destroy ( CMemoryBuffer  argCMemoryBuffer,
idrs_exception *  pargException 
)

Destroys a CMemoryBuffer handle.

Parameters
argCMemoryBufferCMemoryBuffer handle to destroy
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryBuffer_GetData()

IDRS_PVOID CMemoryBuffer_GetData ( const CMemoryBuffer  argCMemoryBuffer,
idrs_exception *  pargException 
)

GetData returns the memory data.

Please note that the provided buffer data has the real size indicated by GetReserved.

Returns
Memory pointer on the data.
Parameters
argCMemoryBufferCMemoryBuffer handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryBuffer_GetReservedCapacity()

IDRS_UINT64 CMemoryBuffer_GetReservedCapacity ( const CMemoryBuffer  argCMemoryBuffer,
idrs_exception *  pargException 
)

GetReserved returns the number of bytes allocated.

Returns
Size in bytes of the allocated buffer
Parameters
argCMemoryBufferCMemoryBuffer handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryBuffer_GetSize()

IDRS_UINT CMemoryBuffer_GetSize ( const CMemoryBuffer  argCMemoryBuffer,
idrs_exception *  pargException 
)

GetSize returns the number of bytes allocated through Resize.

Please note that the total number of bytes in memory allocated might be larger.

Returns
Size in bytes of the allocated buffer
Parameters
argCMemoryBufferCMemoryBuffer handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryBuffer_ReserveCapacity()

void CMemoryBuffer_ReserveCapacity ( CMemoryBuffer  argCMemoryBuffer,
IDRS_UINT64 const  uiMemorySize64,
idrs_exception *  pargException 
)

Reserves memory for the underlying memory buffer.

This method controls how much memory is allocated for the underlying buffer. Providing a lower value that the current size will cause the underlying memory buffer size to be reduced

Parameters
argCMemoryBufferCMemoryBuffer handle
uiMemorySize64The size of memory needed.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CMemoryBuffer_Resize()

void CMemoryBuffer_Resize ( CMemoryBuffer  argCMemoryBuffer,
IDRS_UINT64 const  uiMemorySize64,
idrs_exception *  pargException 
)

Resizes the underlying memory buffer.

If the provided size is larger that current size but lower than the current reserved capacity, then no new memory will be allocated. If the provided size is lower than the current size, then reserved capacity will be lowered to the provided value. If the provided size is higher than the current reserved capacity, then the underlying buffer will be re-allocated. The size of the re-allocated buffer will be at least the size provided for Resize operation. You can get the reserved capacity size using the method GetReservedCapacity.

The size of the memory buffer may be increase or decreased.

Parameters
argCMemoryBufferCMemoryBuffer handle
uiMemorySize64The size of memory needed.
pargExceptionPointer to exception structure that will be filled if an exception occurs