Murl::Pool< DataType > Class Template Reference

A pool template class. More...

#include "murl_pool.h"

Public Types

typedef DataType ValueType
 The template parameter value type. More...

Public Member Functions

 Pool ()
 The default constructor. More...
 ~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. More...
UInt32 mTotalNumberOfItems
 The number of created items. More...

Detailed Description

template<class DataType>
class Murl::Pool< DataType >

A pool template class.

Member Typedef Documentation

◆ ValueType

template<class DataType>
typedef DataType Murl::Pool< DataType >::ValueType

The template parameter value type.

Constructor & Destructor Documentation

◆ Pool()

template<class DataType>
Murl::Pool< DataType >::Pool ( )

The default constructor.

Create an empty pool.

Member Function Documentation

◆ Acquire()

template<class DataType>
DataType* Murl::Pool< DataType >::Acquire ( )

Acquire an item.

Get an item from the pool or allocate a new one.

The item.

◆ Release() [1/2]

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

Release an acquired item.

Put the item to the pool.

itemThe acquired item to put into the pool.

◆ Release() [2/2]

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

Release an array of acquired items.

Put the items to the pool.

itemsThe acquired items to put into the pool.

Member Data Documentation

◆ mFreeItems

template<class DataType>
Array<DataType*> Murl::Pool< DataType >::mFreeItems

◆ mTotalNumberOfItems

template<class DataType>
UInt32 Murl::Pool< DataType >::mTotalNumberOfItems

The number of created items.

Referenced by Murl::Pool< FrameBufferItem >::Acquire(), and Murl::Pool< FrameBufferItem >::~Pool().

The documentation for this class was generated from the following file:
  • murl_pool.h

Copyright © 2011-2018 Spraylight GmbH.