21 #include "ArrayPool.hpp" 
   27 template <
typename P, 
typename T, 
typename U = T>
 
   36     inline bool isEmpty()
 const { 
return firstItem == RNIL; }
 
   53       this->firstItem = src.firstItem;
 
  165   inline bool isEmpty()
 const { 
return head.firstItem == RNIL;}
 
  172 template <
typename P, 
typename T, 
typename U = T>
 
  181     assert(src.in_use == 
false);
 
  188     assert(src.in_use == 
true);
 
  196 template <
typename P, 
typename T, 
typename U>
 
  203   ASSERT_TYPE_HAS_CONSTRUCTOR(T);
 
  206 template <
typename P, 
typename T, 
typename U>
 
  218 template <
typename P, 
typename T, 
typename U>
 
  223   if (likely(thePool.seize(p)))
 
  236 template <
typename P, 
typename T, 
typename U>
 
  241   if (likely(thePool.seizeId(p, ir)))
 
  249 template <
typename P, 
typename T, 
typename U>
 
  254   return thePool.findId(i);
 
  257 template <
typename P, 
typename T, 
typename U>
 
  263   Uint32 ff = head.firstItem;
 
  266   t->U::prevList = RNIL;
 
  267   head.firstItem = p.i;
 
  271     T * t2 = thePool.getPtr(ff);
 
  272     t2->U::prevList = p.i;
 
  276 template <
typename P, 
typename T, 
typename U>
 
  281   Uint32 ff = head.firstItem;
 
  283   head.firstItem = 
first;
 
  284   lastPtr.p->U::nextList = ff;
 
  288     T * t2 = thePool.getPtr(ff);
 
  289     t2->U::prevList = lastPtr.i;
 
  293 template <
typename P, 
typename T, 
typename U>
 
  301 template <
typename P, 
typename T, 
typename U>
 
  307   Uint32 ni = t->U::nextList;
 
  308   Uint32 pi = t->U::prevList;
 
  311     T * tn = thePool.getPtr(ni);
 
  312     tn->U::prevList = pi;
 
  316     T * tp = thePool.getPtr(pi);
 
  317     tp->U::nextList = ni;
 
  326 template <
typename P, 
typename T, 
typename U>
 
  333   p.p = thePool.getPtr(i);
 
  340 template <
typename P, 
typename T, 
typename U>
 
  349 template <
typename P, 
typename T, 
typename U>
 
  355   Uint32 curr = head.firstItem;
 
  358     thePool.getPtr(ptr, curr);
 
  359     curr = ptr.p->U::nextList;
 
  360     thePool.release(ptr);
 
  362   head.firstItem = RNIL;
 
  365 template <
typename P, 
typename T, 
typename U>
 
  370   head.firstItem = RNIL;
 
  373 template <
typename P, 
typename T, 
typename U>
 
  379   p.p = thePool.getPtr(i);
 
  382 template <
typename P, 
typename T, 
typename U>
 
  390 template <
typename P, 
typename T, 
typename U>
 
  395   return thePool.getPtr(i);
 
  403 template <
typename P, 
typename T, 
typename U>
 
  408   Uint32 
i = head.firstItem;
 
  412     p.p = thePool.getPtr(i);
 
  419 template <
typename P, 
typename T, 
typename U>
 
  424   Uint32 
i = p.p->U::nextList;
 
  427     p.p = thePool.getPtr(i);
 
  434 template <
typename P, 
typename T, 
typename U>
 
  439   return p.p->U::nextList != RNIL;
 
  444 template <
typename T, 
typename U = T>
 
  451 template <
typename T, 
typename U = T>