Interface for CMemoryBuffer wrapper.
More...
Go to the source code of this file.
|
| 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.
|
| |
Interface for CMemoryBuffer wrapper.
◆ 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
-
| argCMemoryBuffer | CMemoryBuffer handle |
| uiMemSize | The size of memory needed. |
| pargException | Pointer 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
-
| uiInitialMemoryBufferSize | The initial memory buffer size. |
| pargException | Pointer 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
-
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The newly created memory buffer.
◆ CMemoryBuffer_Create3()
Creates a memory buffer object holding the provided data.
- Parameters
-
| pvData | The data to hold in the buffer. |
| uiDataSize | The size of the data |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The newly created memory buffer.
◆ CMemoryBuffer_Destroy()
| void CMemoryBuffer_Destroy |
( |
CMemoryBuffer |
argCMemoryBuffer, |
|
|
idrs_exception * |
pargException |
|
) |
| |
Destroys a CMemoryBuffer handle.
- Parameters
-
| argCMemoryBuffer | CMemoryBuffer handle to destroy |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ CMemoryBuffer_GetData()
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
-
| argCMemoryBuffer | CMemoryBuffer handle |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ CMemoryBuffer_GetReservedCapacity()
GetReserved returns the number of bytes allocated.
- Returns
- Size in bytes of the allocated buffer
- Parameters
-
| argCMemoryBuffer | CMemoryBuffer handle |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ CMemoryBuffer_GetSize()
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
-
| argCMemoryBuffer | CMemoryBuffer handle |
| pargException | Pointer 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
-
| argCMemoryBuffer | CMemoryBuffer handle |
| uiMemorySize64 | The size of memory needed. |
| pargException | Pointer 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
-
| argCMemoryBuffer | CMemoryBuffer handle |
| uiMemorySize64 | The size of memory needed. |
| pargException | Pointer to exception structure that will be filled if an exception occurs |