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

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

Allocate a pool of nelems size

Parameters:
nelems initial size of the pool

Definition at line 71 of file Pool.H.

Referenced by Pool< vector< unsigned short > >::Pool().

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


Generated by  Doxygen 1.6.0   Back to index