166 elem->next() =
after->next();
167 after->next() = elem;
216 list.the_last->next() =
after->next();
217 after->next() = list.first();
259 if(
after->next() == elem)
276 if(
the_first != 0 && list.the_first != 0)
298 after->next() = list.the_last->next();
348 return (elem ==
the_last) ? 0 : elem->next();
360 for(num = 1; test !=
the_last; test = test->next())
396 part.the_first =
const_cast<T*
>(start);
402 part.the_last =
const_cast<T*
>(end);
429 for(elem =
first(); elem; elem =
next(elem))
431 elem->next() =
reinterpret_cast<T*
>(
reinterpret_cast<char*
>(elem->next()) + delta);
438#ifdef ENABLE_CONSISTENCY_CHECKS
Safe arrays of data objects.
T & last()
reference last element.
IsElement()
default constructor.
IsElement< T > * the_next
pointer to next element in the IsList.
IsElement(const IsElement< T > &old)
copy constructor.
IsElement< T > * next() const
returns the next element in the IsList.
Generic single linked list.
void append(IsList< T > &list)
appends all elements of list to IsList.
T * last() const
returns the IsList's last element.
IsList< T > & operator=(const IsList< T > &old)=delete
IsList(T *pfirst=0, T *plast=0, bool pDestroyElements=false)
default constructor.
T * first() const
returns the IsList's first element.
bool isConsistent() const
consistency check.
void remove(const T *elem)
removes element elem from an IsList.
T * the_last
the last element in the IsList.
void insert(T *elem, T *after)
inserts elem to IsList after its element after.
void append(T *elem)
appends elem to IsList.
T * the_first
the first element in the IsList.
void clear(bool pDestroyElements=false)
removes all elements from an IsList.
void prepend(IsList< T > &list)
prepends all elements of list to IsList.
int length() const
returns the number of elements in IsList.
void remove_next(T *after)
removes the successor of after from an IsList.
void remove(IsList< T > &list)
removes all elements of list from an IsList.
void prepend(T *elem)
prepends elem to IsList.
T * next(const T *elem) const
returns successor of elem in an IsList.
int find(const T *elem) const
returns the position of element elem within IsList.
void move(ptrdiff_t delta)
adjusts list pointers to a new memory address.
bool destroyElements
should the destructor be called for each element when the list is destroyed?
void insert(IsList< T > &list, T *after)
inserts all elements of list after element after of an IsList.
IsList< T > sublist(const T *start=0, const T *end=0) const
constructs sublist of an IsList.
Everything should be within this namespace.
void spx_free(T &p)
Release memory.
#define MSGinconsistent(name)