Open CASCADE Technology 6.6.0
Public Member Functions | Static Public Member Functions | Protected Member Functions
NCollection_BaseAllocator Class Reference

#include <NCollection_BaseAllocator.hxx>

Inheritance diagram for NCollection_BaseAllocator:
Inheritance graph
[legend]

Public Member Functions

virtual void * Allocate (const size_t size)
virtual void Free (void *anAddress)

Static Public Member Functions

static const Handle
< NCollection_BaseAllocator > & 
CommonBaseAllocator (void)
 CommonBaseAllocator This method is designed to have the only one BaseAllocator (to avoid useless copying of collections). However one can use operator new to create more BaseAllocators, but it is injurious.
static void StandardCallBack (const Standard_Boolean theIsAlloc, const Standard_Address theStorage, const Standard_Size theRoundSize, const Standard_Size theSize)
 Callback function to register alloc/free calls.
static void PrintMemUsageStatistics ()
 Prints memory usage statistics cumulated by StandardCallBack.

Protected Member Functions

 NCollection_BaseAllocator (void)
 Constructor - prohibited.

Detailed Description

Purpose: Basic class for memory allocation wizards. Defines the interface for devising different allocators firstly to be used by collections of NCollection, though it it is not deferred. It allocates/frees the memory through Standard procedures, thus it is unnecessary (and sometimes injurious) to have more than one such allocator. To avoid creation of multiple objects the constructors were maid inaccessible. To create the BaseAllocator use the method CommonBaseAllocator. Note that this object is managed by Handle.


Constructor & Destructor Documentation

NCollection_BaseAllocator::NCollection_BaseAllocator ( void  ) [inline, protected]

Member Function Documentation

virtual void* NCollection_BaseAllocator::Allocate ( const size_t  size) [virtual]
static const Handle< NCollection_BaseAllocator >& NCollection_BaseAllocator::CommonBaseAllocator ( void  ) [static]
virtual void NCollection_BaseAllocator::Free ( void *  anAddress) [virtual]
static void NCollection_BaseAllocator::PrintMemUsageStatistics ( ) [static]
static void NCollection_BaseAllocator::StandardCallBack ( const Standard_Boolean  theIsAlloc,
const Standard_Address  theStorage,
const Standard_Size  theRoundSize,
const Standard_Size  theSize 
) [static]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines