#include <fbxcontainerallocators.h>
An allocator class for use as a template parameter to one of the container class (FbxMap, FbxSet2, FbxDynamicArray...) must implement these.
Definition at line 23 of file fbxcontainerallocators.h.
Public Member Functions |
|
| FbxBaseAllocator (const size_t pRecordSize) | |
| The class constructor. |
|
| void | Reserve (const size_t) |
| This tells the allocator that we are about
to call AllocateRecords one or many times to allocate pRecordCount
records. |
|
| void * | AllocateRecords (const size_t pRecordCount=1) |
| Returns a pointer to a uninitialized
continuous block of memory able to hold pRecordCount * pRecordSize
bytes. |
|
| void | FreeMemory (void *pRecord) |
| Frees a block of memory returned by
AllocateRecords. |
|
| size_t | GetRecordSize () const |
| FbxBaseAllocator | ( | const size_t | pRecordSize | ) | [inline] |
The class constructor.
| pRecordSize | the size of one record held by the container. |
Definition at line 32 of file fbxcontainerallocators.h.
:
mRecordSize(pRecordSize)
{
}
| void Reserve | ( | const size_t | ) | [inline] |
This tells the allocator that we are about to call AllocateRecords one or many times to allocate pRecordCount records.
| pRecordCount |
Definition at line 44 of file fbxcontainerallocators.h.
{
// By default, ignore all preallocating requests.
}
| void* AllocateRecords | ( | const size_t | pRecordCount = 1 |
) | [inline] |
Returns a pointer to a uninitialized continuous block of memory able to hold pRecordCount * pRecordSize bytes.
| pRecordCount |
Definition at line 54 of file fbxcontainerallocators.h.
{
return FbxMalloc(pRecordCount * mRecordSize);
}
| void FreeMemory | ( | void * | pRecord | ) | [inline] |
Frees a block of memory returned by AllocateRecords.
| pRecord |
Definition at line 62 of file fbxcontainerallocators.h.
{
FbxFree(pRecord);
}
| size_t GetRecordSize | ( | ) | const [inline] |
Definition at line 69 of file fbxcontainerallocators.h.
{
return mRecordSize;
}