133 return static_cast<T*
>(this->the_first);
139 return static_cast<T*
>(this->the_last);
145 return (elem == last()) ? 0 : elem->
next();
151 return (elem == first()) ? 0 : elem->
prev();
164 last()->next() = elem;
165 elem->prev() = last();
168 this->the_first = elem;
170 this->the_last = elem;
178 elem->next() = first();
179 first()->prev() = elem;
182 this->the_last = elem;
184 this->the_first = elem;
196 elem->next() = after->next();
197 elem->prev() = after;
198 after->next() = elem->next()->prev() = elem;
207 append(list.
first());
208 this->the_last = list.
last();
217 prepend(list.
last());
229 list.
last()->next() = after->next();
230 list.
first()->prev() = after;
231 after->next() = list.
first();
234 this->the_last = list.
last();
236 list.
last()->next()->prev() = list.
last();
255 this->the_first =
next(elem);
260 else if(elem == last())
261 this->the_last = elem->prev();
264 elem->next()->prev() = elem->prev();
265 elem->prev()->next() = elem->next();
272 if(first() != 0 && list.first() != 0)
274 assert(find(list.first()));
275 assert(find(list.last()));
277 if(first() == list.first())
279 if(last() == list.last())
280 this->the_first = this->the_last = 0;
282 this->the_first = list.last()->next();
284 else if(last() == list.last())
285 this->the_last = list.last()->prev();
290 for(; after->next() != list.first(); after = after->next())
293 if(last() == list.last())
294 this->the_last = after;
296 after->next() = list.last()->next();
317 for(elem = last(); elem; elem =
prev(elem))
319 elem->prev() =
reinterpret_cast<T*
>(
320 reinterpret_cast<char*
>(elem->prev()) + delta);
327 #ifdef ENABLE_CONSISTENCY_CHECKS 328 const T* my_first = first();
329 const T* my_last = last();
331 for(
const T* it = my_first; it; it =
next(it))
333 if(it != my_first && it->prev()->next() != it)
336 if(it != my_last && it->next()->prev() != it)
356 IdList(T* pfirst = 0, T* plast = 0,
bool pDestroyElements =
false)
357 :
IsList<T>(pfirst, plast, pDestroyElements)
359 assert(isConsistent());
void remove_next(T *after)
removes element following after.
void append(T *elem)
appends elem to end of list.
Elements for IdLists.IdElements are derived from the template parameter class T and can hence be used...
Generic Real linked list.Class IdList implements an intrusive Real linked list as a template class...
void move(ptrdiff_t delta)
adjusts list pointers to a new memory address.
void move(ptrdiff_t delta)
adjusts list pointers to a new memory address.
IdElement< T > *const & prev() const
returns the previous element in the IdList.
Generic single linked list.
Generic single linked list.Class IsList implements an intrusive single linked list of elements of a t...
void append(IdList< T > &list)
appends list to end of list.
void insert(T *elem, T *after)
inserts elem after after.
IdElement(const T &old)
copy constructor.
IdElement< T > *& prev()
returns the previous element in the IdList (writeable).
DLPSV *& next()
Next SVectorBase.
IdElement< T > * thenext
pointer to next element in the IdList
T * next(const T *elem) const
returns successor of elem or 0, if elem is the last element.
Debugging, floating point type and parameter definitions.
Everything should be within this namespace.
IdElement< T > * theprev
pointer to previous element in the IdList
T * prev(const T *elem) const
returns predecessor of elem or 0, if elem is the first element.
void insert(IdList< T > &list, T *after)
inserts list after after.
IdElement()
default constructor.
void prepend(IdList< T > &list)
prepends list at beginnig of list.
IdElement< T > *& next()
returns the next element in the IdList (writeable).
IdElement< T > *const & next() const
returns the next element in the IdList.
void prepend(T *elem)
prepends elem at beginnig of list.
bool isConsistent() const
consistency check.
T * the_first
the first element in the IsList.
DLPSV *const & prev() const
Previous SVectorBase.
#define MSGinconsistent(name)
T * last() const
returns last element in list.
T * first() const
returns first element in list.
bool isConsistent() const
consistency check.
IdList(T *pfirst=0, T *plast=0, bool pDestroyElements=false)
default constructor.