22 #include "ArrayPool.hpp"
29 template <
typename P,
typename T,
typename U = T>
38 void init() { firstItem = RNIL;}
44 this->firstItem = src.firstItem;
122 p.p->U::nextList = head.firstItem;
123 head.firstItem = p.i;
139 Uint32 noOfElements()
const {
141 Uint32
i = head.firstItem;
144 const T * t = thePool.getPtr(i);
155 out <<
"firstItem = " << head.firstItem << endl;
156 Uint32 i = head.firstItem;
158 T * t = thePool.getPtr(i);
159 t->print(out); out <<
" ";
164 inline bool empty()
const {
return head.firstItem == RNIL;}
171 template <
typename P,
typename T,
typename U = T>
188 template <
typename P,
typename T,
typename U>
195 template <
typename P,
typename T,
typename U>
202 template <
typename P,
typename T,
typename U>
209 Uint32 ff = head.firstItem;
213 head.firstItem = p.i;
219 template <
typename P,
typename T,
typename U>
224 thePool.seizeId(p, ir);
226 Uint32 ff = head.firstItem;
230 head.firstItem = p.i;
236 template <
typename P,
typename T,
typename U>
241 for(Uint32 i = 0; i <
n; i++)
250 p.i = head.firstItem;
252 head.firstItem = p.p->U::nextList;
262 p.i = head.firstItem;
263 p.p = thePool.getPtr(head.firstItem);
269 template <
typename P,
typename T,
typename U>
274 head.firstItem = RNIL;
277 template <
typename P,
typename T,
typename U>
282 p.i = head.firstItem;
285 p.p = thePool.getPtr(p.i);
286 head.firstItem = p.p->U::nextList;
292 template <
typename P,
typename T,
typename U>
297 last.p->U::nextList = head.firstItem;
298 head.firstItem =
first;
301 template <
typename P,
typename T,
typename U>
307 Uint32 curr = head.firstItem;
310 thePool.getPtr(ptr, curr);
311 curr = ptr.p->U::nextList;
312 thePool.release(ptr);
314 head.firstItem = RNIL;
317 template <
typename P,
typename T,
typename U>
323 p.p = thePool.getPtr(i);
326 template <
typename P,
typename T,
typename U>
334 template <
typename P,
typename T,
typename U>
339 return thePool.getPtr(i);
347 template <
typename P,
typename T,
typename U>
352 Uint32 i = head.firstItem;
356 p.p = thePool.getPtr(i);
363 template <
typename P,
typename T,
typename U>
368 Uint32 i = p.p->U::nextList;
372 p.p = thePool.getPtr(i);
379 template <
typename P,
typename T,
typename U>
384 return p.p->U::nextList != RNIL;
389 template <
typename T,
typename U = T>
396 template <
typename T,
typename U = T>