# FoundationClasses
TKernel
NCollection

# NCollection_BaseAllocator Class Reference

`#include <NCollection_BaseAllocator.hxx>`

Inheritance diagram for NCollection_BaseAllocator:

[legend]

## Public Member Functions

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

## Static Public Member Functions

static Standard_EXPORT 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.

## Protected Member Functions

| NCollection_BaseAllocator (void)
| Constructor - prohibited.

## Private Member Functions

| NCollection_BaseAllocator (const NCollection_BaseAllocator &)
| Copy 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]`

NCollection_BaseAllocator::NCollection_BaseAllocator | ( | const NCollection_BaseAllocator & |  | ) | `[private]`

## Member Function Documentation

virtual Standard_EXPORT void* NCollection_BaseAllocator::Allocate | ( | const size_t | size | ) | `[virtual]`

| Reimplemented in NCollection_IncAllocator.

virtual Standard_EXPORT void NCollection_BaseAllocator::Free | ( | void * | anAddress | ) | `[virtual]`

| Reimplemented in NCollection_IncAllocator.

static Standard_EXPORT const NCollection_BaseAllocator::Handle | ( | NCollection_BaseAllocator |  | ) | `[static]`

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

- NCollection_BaseAllocator.hxx