Logo Search packages:      
Sourcecode: lttoolbox version File versions  Download package

template<class T>
void Pool< T >::init ( unsigned int const   nelems,
T const &  object 
) [inline, private]

Allocate a pool of nelems size with objects equal to 'object'

Parameters:
nelems initial size of the pool
object initial value of the objects in the pool

Definition at line 88 of file Pool.H.

  {
    created.clear();
    free.clear();
    for(unsigned int i = 0; i != nelems; i++)
    {
      created.push_front(object);
      free.push_front(&(*(created.begin())));
    }
  }


Generated by  Doxygen 1.6.0   Back to index