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

template<class T>
T* Pool< T >::get (  )  [inline]

Allocate a pointer to a free 'new' object.

Returns:
pointer to the object

Definition at line 149 of file Pool.H.

Referenced by State::apply(), State::copy(), State::epsilonClosure(), and State::init().

  {
    if(free.size() != 0)
    {
      T *result = *(free.begin());
      free.erase(free.begin());
      return result;
    }
    else
    {
      T tmp;
      created.push_front(tmp);
      return &(*(created.begin()));
    }
  }  


Generated by  Doxygen 1.6.0   Back to index