18 #ifndef SLFIFOLIST_HPP
19 #define SLFIFOLIST_HPP
21 #include <ndb_global.h>
22 #include <kernel_types.h>
29 template <
typename P,
typename T,
typename U = T>
45 inline bool isEmpty()
const {
return firstItem == RNIL;}
50 Head() { this->init();}
53 this->firstItem = src.firstItem;
54 this->lastItem = src.lastItem;
56 this->in_use = src.in_use;
65 bool seize(
Ptr<T> & ptr) {
return seizeLast(ptr);}
67 void releaseFirst(
Ptr<T> &);
72 void removeFirst(
Ptr<T> &);
73 void remove() { head.init(); }
118 inline bool isEmpty()
const {
return head.firstItem == RNIL;}
125 template <
typename P,
typename T,
typename U = T>
134 assert(src.in_use ==
false);
141 assert(src.in_use ==
true);
149 template <
typename P,
typename T,
typename U>
156 template <
typename P,
typename T,
typename U>
161 this->firstItem = RNIL;
162 this->lastItem = RNIL;
164 this->in_use =
false;
168 template <
typename P,
typename T,
typename U>
173 if (likely(thePool.seize(p)))
182 template <
typename P,
typename T,
typename U>
187 if (likely(thePool.seize(p)))
196 template <
typename P,
typename T,
typename U>
201 Uint32
first = head.firstItem;
202 head.firstItem = p.i;
207 p.p->U::nextList =
first;
210 template <
typename P,
typename T,
typename U>
216 Uint32
last = head.lastItem;
218 t->U::nextList = RNIL;
223 T * t2 = thePool.getPtr(last);
224 t2->U::nextList = p.i;
228 head.firstItem = p.i;
232 template <
typename P,
typename T,
typename U>
237 Uint32 first = head.firstItem;
238 Uint32 last = head.lastItem;
239 assert(p.i == first);
242 head.firstItem = p.p->U::nextList;
246 head.firstItem = head.lastItem = RNIL;
250 template <
typename P,
typename T,
typename U>
259 template <
typename P,
typename T,
typename U>
265 p.p = thePool.getPtr(i);
268 template <
typename P,
typename T,
typename U>
276 template <
typename P,
typename T,
typename U>
281 return thePool.getPtr(i);
289 template <
typename P,
typename T,
typename U>
294 p.i = head.firstItem;
297 p.p = thePool.getPtr(p.i);
304 template <
typename P,
typename T,
typename U>
312 p.p = thePool.getPtr(p.i);
319 template <
typename P,
typename T,
typename U>
324 p.i = p.p->U::nextList;
327 p.p = thePool.getPtr(p.i);
334 template <
typename P,
typename T,
typename U>
339 return p.p->U::nextList != RNIL;
344 template <
typename T,
typename U = T>
351 template <
typename T,
typename U = T>