Cafu Engine
cf::PoolNoFreeT< T > Class Template Reference

This class manages memory for a pool of objects. More...

#include "Pool.hpp"

Public Member Functions

 PoolNoFreeT (unsigned long SizeOfFirstBlock=8)
 
T * Alloc (unsigned long Size=1)
 Returns a pointer to Size allocated objects of type T. More...
 
void Free (T *)
 
unsigned long GetSize () const
 

Detailed Description

template<class T>
class cf::PoolNoFreeT< T >

This class manages memory for a pool of objects.

Works best for POD- and simple class types, because:

  • Only calls the default ctor.
  • Does not really free the elements, only when the entire pool is deleted.
  • Works best when only small arrays (with few elements) are alloc'ed, so that there is not too much Verschnitt.
  • GetSize() does not take calls Free() into account.

Member Function Documentation

template<class T>
T* cf::PoolNoFreeT< T >::Alloc ( unsigned long  Size = 1)
inline

Returns a pointer to Size allocated objects of type T.


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