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 >
DataType* Murl::Pool< DataType >::Acquire ( )
inline

◆ Release() [1/2]

template<class DataType >
void Murl::Pool< DataType >::Release ( DataType *  item)
inline

Release an acquired item.

Put the item to the pool.

Parameters
itemThe acquired item to put into the pool.

References Murl::Array< DataType >::Add(), and Murl::Pool< DataType >::mFreeItems.

◆ Release() [2/2]

template<class DataType >
void Murl::Pool< DataType >::Release ( const Array< DataType * > &  items)
inline

Release an array of acquired items.

Put the items to the pool.

Parameters
itemsThe 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


Copyright © 2011-2024 Spraylight GmbH.