106 template<
typename S,
typename E, E* S::*first, E* E::*next>
class EStack;
108 template<
typename E, E* E::*prev, E* E::*next>
class EListIterator;
110 template<
typename L,
typename E,
int L::*numElem, E* L::*first, E* L::*last, E* E::*next, E* E::*prev>
class EList;
113 template<
typename S,
typename E, E* S::*first, E* E::*next>
118 static inline void init(S* pStack)
124 static inline void pop(S* pStack)
126 pStack->*first = pStack->*first->*next;
132 E* res = pStack->*first;
133 pStack->*first = pStack->*first->*next;
138 static inline void push(S* pStack, E* pElem)
140 pElem->*next = pStack->*first;
141 pStack->*first = pElem;
145 static inline E*
top(
const S* pStack)
147 return pStack->*first;
151 static inline bool empty(
const S* pStack)
153 return (pStack->*first == 0);
159 template<
typename E, E* E::*prev, E* E::*next>
253 static inline void init(L* pList)
261 static inline int size(
const L* pList) {
return (pList->*numElem); }
264 static inline bool empty(
const L* pList) {
return (pList->*first == 0); }
267 static inline E*
front(
const L* pList) {
return pList->*first; }
270 static inline E*
back(
const L* pList) {
return pList->*last; }
276 elem->*prev = pList->*last;
278 pList->*last = pList->*last->*next = elem;
280 pList->*last = pList->*first = elem;
289 elem->*next = pList->*first;
293 pList->*first = pList->*first->*prev = elem;
295 pList->*first = pList->*last = elem;
308 pPrev = pNext->*prev;
322 pList->*first = elem;
340 pNext = pPrev->*next;
354 pList->*first = elem;
370 remove(pList,
front(pList));
377 remove(pList,
back(pList));
383 E* pPrev = elem->*prev;
384 E* pNext = elem->*next;
386 pPrev->*next = pNext;
388 pList->*first = pNext;
390 pNext->*prev = pPrev;
392 pList->*last = pPrev;
401 return remove(pList, (E*)(*it));
406 E* L_other::*other_first,
407 E* L_other::*other_last,
408 int L_other::*other_numElem
410 inline static void appendFrom( L* pList, L_other* pListOther )
412 if (!pListOther->*other_first)
417 pList->*first = pListOther->*other_first;
418 pList->*last = pListOther->*other_last;
422 pList->*last->*next = pListOther->*other_first;
423 pListOther->*other_first->*prev = pList->*last;
426 pList->*last = pListOther->*other_first;
430 pList->*numElem += pListOther->*other_numElem;
432 pListOther->*other_numElem = 0;
433 pListOther->*other_first = 0;
434 pListOther->*other_last = 0;
449 template<
typename Func>
450 static inline void forall(
const L* pList,
const Func& func)
458 template<
typename A1>
459 static inline void forall_call(
const L* pList,
void (E::*func)( A1 ),
const A1& a1)