API Documentation
Public Member Functions | List of all members
nkMemory::Allocator< T > Class Template Referenceabstract

Interface representing an allocator, supposed to allocate an object when requested. More...

Inheritance diagram for nkMemory::Allocator< T >:
nkMemory::DefaultAllocator< T >

Public Member Functions

 Allocator () noexcept=default
 
virtual ~Allocator ()=default
 
virtual T * allocate ()=0
 

Detailed Description

template<typename T>
class nkMemory::Allocator< T >

Interface representing an allocator, supposed to allocate an object when requested.

This is used with Pools to allow external code to allocate any needed object.

Constructor & Destructor Documentation

◆ Allocator()

template<typename T >
nkMemory::Allocator< T >::Allocator ( )
defaultnoexcept

Constructor.

◆ ~Allocator()

template<typename T >
virtual nkMemory::Allocator< T >::~Allocator ( )
virtualdefault

Desttructor.

Member Function Documentation

◆ allocate()

template<typename T >
virtual T* nkMemory::Allocator< T >::allocate ( )
pure virtual

Called whenever an allocation has to occur.

Returns
Has to return a pointer over the object allocated.

Implemented in nkMemory::DefaultAllocator< T >.


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