142 return static_cast<T*
>(this->the_first);
148 return static_cast<T*
>(this->the_last);
154 return (elem == last()) ? 0 : elem->
next();
160 return (elem == first()) ? 0 : elem->
prev();
173 last()->next() = elem;
174 elem->prev() = last();
177 this->the_first = elem;
179 this->the_last = elem;
187 elem->next() = first();
188 first()->prev() = elem;
191 this->the_last = elem;
193 this->the_first = elem;
205 elem->next() = after->next();
206 elem->prev() = after;
207 after->next() = elem->next()->prev() = elem;
216 append(list.
first());
217 this->the_last = list.
last();
226 prepend(list.
last());
238 list.
last()->next() = after->next();
239 list.
first()->prev() = after;
240 after->next() = list.
first();
243 this->the_last = list.
last();
245 list.
last()->next()->prev() = list.
last();
264 this->the_first =
next(elem);
269 else if(elem == last())
270 this->the_last = elem->prev();
273 elem->next()->prev() = elem->prev();
274 elem->prev()->next() = elem->next();
281 if(first() != 0 && list.first() != 0)
283 assert(
find(list.first()));
284 assert(
find(list.last()));
286 if(first() == list.first())
288 if(last() == list.last())
289 this->the_first = this->the_last = 0;
291 this->the_first = list.last()->next();
293 else if(last() == list.last())
294 this->the_last = list.last()->prev();
299 for(; after->next() != list.first(); after = after->next())
302 if(last() == list.last())
303 this->the_last = after;
305 after->next() = list.last()->next();
326 for(elem = last(); elem; elem =
prev(elem))
328 elem->prev() =
reinterpret_cast<T*
>(
329 reinterpret_cast<char*
>(elem->prev()) + delta);
336 #ifdef ENABLE_CONSISTENCY_CHECKS 337 const T* my_first = first();
338 const T* my_last = last();
340 for(
const T* it = my_first; it; it =
next(it))
342 if(it != my_first && it->prev()->next() != it)
345 if(it != my_last && it->next()->prev() != it)
365 IdList(T* pfirst = 0, T* plast = 0,
bool pDestroyElements =
false)
366 :
IsList<T>(pfirst, plast, pDestroyElements)
368 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...
#define SPX_MSG_INCONSISTENT(name)
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.
FMT_CONSTEXPR bool find(Ptr first, Ptr last, T value, Ptr &out)
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.
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.