CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csObjectPool< T > Class Template Reference

This class defines a 'pool' class for the given type. More...

#include <objpool.h>

List of all members.

Public Methods

T * Alloc ()
 Get an object from the pool.

void Free (T *o)
 Give an object back to the pool.


Detailed Description

template<class T>
class csObjectPool< T >

This class defines a 'pool' class for the given type.

This class can be used to create objects of the given type, but it will re-use older objects if possible to save time. For this reason, unused objects of the given type should not be deleted but given to the pool.

Definition at line 32 of file objpool.h.


Member Function Documentation

template<class T>
T* csObjectPool< T >::Alloc   [inline]
 

Get an object from the pool.

Definition at line 39 of file objpool.h.

References csArray< T *, csPDelArrayElementHandler< T * > >::Length(), and csPDelArray< T >::Pop().

template<class T>
void csObjectPool< T >::Free T *    o [inline]
 

Give an object back to the pool.

Definition at line 48 of file objpool.h.

References csArray< T *, csPDelArrayElementHandler< T * > >::Push().


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18