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

A thread-safe object allocation pool. More...

#include <pool.h>

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

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>
class lunchbox::Pool< T >

A thread-safe object allocation pool.

Definition at line 29 of file pool.h.

Constructor & Destructor Documentation

template<typename T >
lunchbox::Pool< T >::Pool ( )
inline

Construct a new pool.

Version
1.0

Definition at line 33 of file pool.h.

template<typename T >
virtual lunchbox::Pool< T >::~Pool ( )
inlinevirtual

Destruct this pool.

Version
1.0

Definition at line 35 of file pool.h.

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

+ Here is the call graph for this function:

Member Function Documentation

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

Definition at line 37 of file pool.h.

template<typename T >
void lunchbox::Pool< T >::flush ( )
inline

Delete all cached items.

Version
1.0

Definition at line 56 of file pool.h.

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

+ Here is the caller graph for this function:

template<typename T >
void lunchbox::Pool< T >::release ( T *  item)
inline

Release an item for reuse.

Version
1.0

Definition at line 49 of file pool.h.


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