Murl::Pool< DataType > Class Template Reference
A pool template class. More...
#include "murl_pool.h"
Public Types | |
using | ValueType = DataType |
The template parameter value type. | |
Public Member Functions | |
~Pool () | |
The destructor. | |
DataType * | Acquire () |
Acquire an item. More... | |
void | Release (DataType *item) |
Release an acquired item. More... | |
void | Release (const Array< DataType * > &items) |
Release an array of acquired items. More... | |
Protected Attributes | |
Array< DataType * > | mFreeItems |
The pool array. | |
UInt32 | mTotalNumberOfItems |
The number of created items. | |
Detailed Description
template<class DataType>
class Murl::Pool< DataType >
A pool template class.
Member Function Documentation
◆ Acquire()
template<class DataType >
|
inline |
Acquire an item.
Get an item from the pool or allocate a new one.
- Returns
- The item.
References Murl::Array< DataType >::Drop(), Murl::Array< DataType >::GetCount(), Murl::Pool< DataType >::mFreeItems, Murl::Pool< DataType >::mTotalNumberOfItems, and Murl::Array< DataType >::Top().
◆ Release() [1/2]
template<class DataType >
|
inline |
Release an acquired item.
Put the item to the pool.
- Parameters
-
item The acquired item to put into the pool.
References Murl::Array< DataType >::Add(), and Murl::Pool< DataType >::mFreeItems.
◆ Release() [2/2]
template<class DataType >
|
inline |
Release an array of acquired items.
Put the items to the pool.
- Parameters
-
items The acquired items to put into the pool.
References Murl::Array< DataType >::Add(), and Murl::Pool< DataType >::mFreeItems.
The documentation for this class was generated from the following file:
- murl_pool.h