TDME2 1.9.121
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Pool< T > Class Template Referenceabstract

Pool template class. More...

#include <tdme/utilities/Pool.h>

Collaboration diagram for Pool< T >:
Collaboration graph

Public Member Functions

 Pool ()
 Public constructor. More...
 
virtual ~Pool ()
 
allocate ()
 Allocate a new element from pool. More...
 
void release (T element)
 Release element in pool for being reused. More...
 
int32_t capacity ()
 
int32_t size ()
 
void reset ()
 Reset this pool. More...
 

Protected Member Functions

virtual T instantiate ()=0
 Instantiate element. More...
 

Private Attributes

vector< T > freeElements
 
vector< T > usedElements
 

Detailed Description

template<typename T>
class tdme::utilities::Pool< T >

Pool template class.

Author
Andreas Drewke
Version
$Id$
Parameters
<E>

Definition at line 21 of file Pool.h.

Constructor & Destructor Documentation

◆ Pool()

Pool ( )
inline

Public constructor.

Definition at line 37 of file Pool.h.

◆ ~Pool()

virtual ~Pool ( )
inlinevirtual

Definition at line 40 of file Pool.h.

Member Function Documentation

◆ allocate()

T allocate ( )
inline

Allocate a new element from pool.

Returns
element

Definition at line 53 of file Pool.h.

◆ capacity()

int32_t capacity ( )
inline
Returns
element capacity

Definition at line 82 of file Pool.h.

◆ instantiate()

virtual T instantiate ( )
protectedpure virtual

◆ release()

void release ( element)
inline

Release element in pool for being reused.

Parameters
elementelement

Definition at line 69 of file Pool.h.

◆ reset()

void reset ( )
inline

Reset this pool.

Definition at line 96 of file Pool.h.

◆ size()

int32_t size ( )
inline
Returns
elements in use

Definition at line 89 of file Pool.h.

Member Data Documentation

◆ freeElements

vector<T> freeElements
private

Definition at line 24 of file Pool.h.

◆ usedElements

vector<T> usedElements
private

Definition at line 25 of file Pool.h.


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