Lunchbox  1.15.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
lunchbox::Pool< T, locked > Class Template Reference

An object allocation pool. More...

#include <pool.h>

+ Inheritance diagram for lunchbox::Pool< T, locked >:
+ Collaboration diagram for lunchbox::Pool< T, locked >:

Public Member Functions

 Pool ()
 Construct a new pool. More...
 
virtual ~Pool ()
 Destruct this pool. More...
 
T * alloc ()
 
void release (T *item)
 Release an item for reuse. More...
 
void flush ()
 Delete all cached items. More...
 

Detailed Description

template<typename T, bool locked = false>
class lunchbox::Pool< T, locked >

An object allocation pool.

Definition at line 29 of file pool.h.

Constructor & Destructor Documentation

template<typename T , bool locked = false>
lunchbox::Pool< T, locked >::Pool ( )
inline

Construct a new pool.

Version
1.0

Definition at line 33 of file pool.h.

template<typename T , bool locked = false>
virtual lunchbox::Pool< T, locked >::~Pool ( )
inlinevirtual

Destruct this pool.

Version
1.0

Definition at line 36 of file pool.h.

References lunchbox::Pool< T, locked >::flush().

+ Here is the call graph for this function:

Member Function Documentation

template<typename T , bool locked = false>
T* lunchbox::Pool< T, locked >::alloc ( )
inline
Returns
a reusable or new item.
Version
1.0

Definition at line 39 of file pool.h.

template<typename T , bool locked = false>
void lunchbox::Pool< T, locked >::flush ( )
inline

Delete all cached items.

Version
1.0

Definition at line 60 of file pool.h.

Referenced by lunchbox::Pool< T, locked >::~Pool().

+ Here is the caller graph for this function:

template<typename T , bool locked = false>
void lunchbox::Pool< T, locked >::release ( T *  item)
inline

Release an item for reuse.

Version
1.0

Definition at line 52 of file pool.h.


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