Generic Real linked list.Class IdList implements an intrusive Real linked list as a template class. As such, the list elements must provide the links themselfs. For conveniance, we also provide class IdElement that adds both links to an arbitrary class as template parameter. More...
#include <idlist.h>
Public Member Functions | |
Access | |
T * | first () const |
returns first element in list. More... | |
T * | last () const |
returns last element in list. More... | |
T * | next (const T *elem) const |
returns successor of elem or 0, if elem is the last element. More... | |
T * | prev (const T *elem) const |
returns predecessor of elem or 0, if elem is the first element. More... | |
Extension | |
void | append (T *elem) |
appends elem to end of list. More... | |
void | prepend (T *elem) |
prepends elem at beginnig of list. More... | |
void | insert (T *elem, T *after) |
inserts elem after after . More... | |
void | append (IdList< T > &list) |
appends list to end of list. More... | |
void | prepend (IdList< T > &list) |
prepends list at beginnig of list. More... | |
void | insert (IdList< T > &list, T *after) |
inserts list after after . More... | |
Removal | |
void | remove_next (T *after) |
removes element following after . More... | |
void | remove (T *elem) |
removes elem from list. More... | |
void | remove (IdList< T > &list) |
removes sublist list . More... | |
Miscellaneous | |
void | move (ptrdiff_t delta) |
adjusts list pointers to a new memory address. More... | |
bool | isConsistent () const |
consistency check. More... | |
Constructors / Destructors | |
IdList (T *pfirst=0, T *plast=0, bool pDestroyElements=false) | |
default constructor. More... | |
Public Member Functions inherited from IsList< T > | |
void | append (T *elem) |
appends elem to IsList. More... | |
void | prepend (T *elem) |
prepends elem to IsList. More... | |
void | insert (T *elem, T *after) |
inserts elem to IsList after its element after . More... | |
void | append (IsList< T > &list) |
appends all elements of list to IsList. More... | |
void | prepend (IsList< T > &list) |
prepends all elements of list to IsList. More... | |
void | insert (IsList< T > &list, T *after) |
inserts all elements of list after element after of an IsList. More... | |
void | remove_next (T *after) |
removes the successor of after from an IsList. More... | |
void | remove (const T *elem) |
removes element elem from an IsList. More... | |
void | remove (IsList< T > &list) |
removes all elements of list from an IsList. More... | |
void | clear (bool pDestroyElements=false) |
removes all elements from an IsList. More... | |
T * | first () const |
returns the IsList's first element. More... | |
T * | last () const |
returns the IsList's last element. More... | |
T * | next (const T *elem) const |
returns successor of elem in an IsList. More... | |
int | length () const |
returns the number of elements in IsList. More... | |
int | find (const T *elem) const |
returns the position of element elem within IsList. More... | |
IsList< T > | sublist (const T *start=0, const T *end=0) const |
constructs sublist of an IsList. More... | |
void | move (ptrdiff_t delta) |
adjusts list pointers to a new memory address. More... | |
bool | isConsistent () const |
consistency check. More... | |
IsList (T *pfirst=0, T *plast=0, bool pDestroyElements=false) | |
default constructor. More... | |
~IsList () | |
destructor More... | |
Additional Inherited Members | |
Public Types inherited from IsList< T > | |
typedef IsElement< T > | Element |
Protected Attributes inherited from IsList< T > | |
T * | the_first |
the first element in the IsList. More... | |
T * | the_last |
the last element in the IsList. More... | |
bool | destroyElements |
should the destructor be called for each element when the list is destroyed? More... | |
Generic Real linked list.
Class IdList implements an intrusive Real linked list as a template class. As such, the list elements must provide the links themselfs. For conveniance, we also provide class IdElement that adds both links to an arbitrary class as template parameter.
|
explicit |
void append | ( | T * | elem | ) |
appends elem
to end of list.
Definition at line 160 of file idlist.h.
Referenced by SVSetBase< Rational >::create(), and SVSetBase< Rational >::xtend().
void append | ( | IdList< T > & | list | ) |
T* first | ( | ) | const |
returns first element in list.
Definition at line 131 of file idlist.h.
Referenced by IdList< soplex::SVSetBase::DLPSV >::append(), SVSetBase< Rational >::countUnusedMem(), SVSetBase< Rational >::deleteVec(), IdList< soplex::SVSetBase::DLPSV >::insert(), SVSetBase< Rational >::isConsistent(), SVSetBase< Rational >::memPack(), SVSetBase< Rational >::memRemax(), IdList< soplex::SVSetBase::DLPSV >::prepend(), and SVSetBase< Rational >::xtend().
void insert | ( | T * | elem, |
T * | after | ||
) |
void insert | ( | IdList< T > & | list, |
T * | after | ||
) |
bool isConsistent | ( | ) | const |
consistency check.
Definition at line 325 of file idlist.h.
Referenced by SVSetBase< Rational >::isConsistent().
T* last | ( | ) | const |
returns last element in list.
Definition at line 137 of file idlist.h.
Referenced by IdList< soplex::SVSetBase::DLPSV >::append(), SVSetBase< Rational >::deleteVec(), SVSetBase< Rational >::ensureMem(), IdList< soplex::SVSetBase::DLPSV >::insert(), IdList< soplex::SVSetBase::DLPSV >::prepend(), and SVSetBase< Rational >::xtend().
void move | ( | ptrdiff_t | delta | ) |
adjusts list pointers to a new memory address.
When all elements have been moved in memory (e.g. because of reallocation) with a fixed offset delta
, the list will be reset to the new adresses.
Definition at line 310 of file idlist.h.
Referenced by SVSetBase< Rational >::reMax().
T* next | ( | const T * | elem | ) | const |
returns successor of elem
or 0, if elem
is the last element.
Definition at line 143 of file idlist.h.
Referenced by SVSetBase< Rational >::countUnusedMem(), SVSetBase< Rational >::isConsistent(), SVSetBase< Rational >::memPack(), and SVSetBase< Rational >::memRemax().
void prepend | ( | T * | elem | ) |
void prepend | ( | IdList< T > & | list | ) |
T* prev | ( | const T * | elem | ) | const |
void remove | ( | T * | elem | ) |
removes elem
from list.
Definition at line 251 of file idlist.h.
Referenced by SVSetBase< Rational >::deleteVec(), and SVSetBase< Rational >::xtend().