#include <elst.h>
List of all members.
Detailed Description
Definition at line 188 of file elst.h.
Constructor & Destructor Documentation
ELIST_ITERATOR::ELIST_ITERATOR |
( |
| ) |
[inline] |
ELIST_ITERATOR::ELIST_ITERATOR |
( |
ELIST * |
list_to_iterate | ) |
[inline] |
Member Function Documentation
void ELIST_ITERATOR::add_after_stay_put |
( |
ELIST_LINK * |
new_link | ) |
[inline] |
Definition at line 385 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::add_after_stay_put", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::add_after_stay_put", ABORT, NULL);
if (!new_element)
BAD_PARAMETER.error ("ELIST_ITERATOR::add_after_stay_put", ABORT,
"new_element is NULL");
if (new_element->next)
STILL_LINKED.error ("ELIST_ITERATOR::add_after_stay_put", ABORT, NULL);
#endif
if (list->empty ()) {
new_element->next = new_element;
list->last = new_element;
prev = next = new_element;
ex_current_was_last = FALSE;
current = NULL;
}
else {
new_element->next = next;
if (current) {
current->next = new_element;
if (prev == current)
prev = new_element;
if (current == list->last)
list->last = new_element;
}
else {
prev->next = new_element;
if (ex_current_was_last) {
list->last = new_element;
ex_current_was_last = FALSE;
}
}
next = new_element;
}
}
void ELIST_ITERATOR::add_after_then_move |
( |
ELIST_LINK * |
new_link | ) |
[inline] |
Definition at line 338 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::add_after_then_move", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::add_after_then_move", ABORT, NULL);
if (!new_element)
BAD_PARAMETER.error ("ELIST_ITERATOR::add_after_then_move", ABORT,
"new_element is NULL");
if (new_element->next)
STILL_LINKED.error ("ELIST_ITERATOR::add_after_then_move", ABORT, NULL);
#endif
if (list->empty ()) {
new_element->next = new_element;
list->last = new_element;
prev = next = new_element;
}
else {
new_element->next = next;
if (current) {
current->next = new_element;
prev = current;
if (current == list->last)
list->last = new_element;
}
else {
prev->next = new_element;
if (ex_current_was_last)
list->last = new_element;
if (ex_current_was_cycle_pt)
cycle_pt = new_element;
}
}
current = new_element;
}
void ELIST_ITERATOR::add_before_stay_put |
( |
ELIST_LINK * |
new_link | ) |
[inline] |
Definition at line 479 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::add_before_stay_put", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::add_before_stay_put", ABORT, NULL);
if (!new_element)
BAD_PARAMETER.error ("ELIST_ITERATOR::add_before_stay_put", ABORT,
"new_element is NULL");
if (new_element->next)
STILL_LINKED.error ("ELIST_ITERATOR::add_before_stay_put", ABORT, NULL);
#endif
if (list->empty ()) {
new_element->next = new_element;
list->last = new_element;
prev = next = new_element;
ex_current_was_last = TRUE;
current = NULL;
}
else {
prev->next = new_element;
if (current) {
new_element->next = current;
if (next == current)
next = new_element;
}
else {
new_element->next = next;
if (ex_current_was_last)
list->last = new_element;
}
prev = new_element;
}
}
void ELIST_ITERATOR::add_before_then_move |
( |
ELIST_LINK * |
new_link | ) |
[inline] |
Definition at line 435 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::add_before_then_move", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::add_before_then_move", ABORT, NULL);
if (!new_element)
BAD_PARAMETER.error ("ELIST_ITERATOR::add_before_then_move", ABORT,
"new_element is NULL");
if (new_element->next)
STILL_LINKED.error ("ELIST_ITERATOR::add_before_then_move", ABORT, NULL);
#endif
if (list->empty ()) {
new_element->next = new_element;
list->last = new_element;
prev = next = new_element;
}
else {
prev->next = new_element;
if (current) {
new_element->next = current;
next = current;
}
else {
new_element->next = next;
if (ex_current_was_last)
list->last = new_element;
if (ex_current_was_cycle_pt)
cycle_pt = new_element;
}
}
current = new_element;
}
void ELIST_ITERATOR::add_list_after |
( |
ELIST * |
list_to_add | ) |
[inline] |
Definition at line 524 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::add_list_after", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::add_list_after", ABORT, NULL);
if (!list_to_add)
BAD_PARAMETER.error ("ELIST_ITERATOR::add_list_after", ABORT,
"list_to_add is NULL");
#endif
if (!list_to_add->empty ()) {
if (list->empty ()) {
list->last = list_to_add->last;
prev = list->last;
next = list->First ();
ex_current_was_last = TRUE;
current = NULL;
}
else {
if (current) {
current->next = list_to_add->First ();
if (current == list->last)
list->last = list_to_add->last;
list_to_add->last->next = next;
next = current->next;
}
else {
prev->next = list_to_add->First ();
if (ex_current_was_last) {
list->last = list_to_add->last;
ex_current_was_last = FALSE;
}
list_to_add->last->next = next;
next = prev->next;
}
}
list_to_add->last = NULL;
}
}
void ELIST_ITERATOR::add_list_before |
( |
ELIST * |
list_to_add | ) |
[inline] |
Definition at line 574 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::add_list_before", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::add_list_before", ABORT, NULL);
if (!list_to_add)
BAD_PARAMETER.error ("ELIST_ITERATOR::add_list_before", ABORT,
"list_to_add is NULL");
#endif
if (!list_to_add->empty ()) {
if (list->empty ()) {
list->last = list_to_add->last;
prev = list->last;
current = list->First ();
next = current->next;
ex_current_was_last = FALSE;
}
else {
prev->next = list_to_add->First ();
if (current) {
list_to_add->last->next = current;
}
else {
list_to_add->last->next = next;
if (ex_current_was_last)
list->last = list_to_add->last;
if (ex_current_was_cycle_pt)
cycle_pt = prev->next;
}
current = prev->next;
next = current->next;
}
list_to_add->last = NULL;
}
}
void ELIST_ITERATOR::add_to_end |
( |
ELIST_LINK * |
new_link | ) |
[inline] |
bool ELIST_ITERATOR::at_first |
( |
| ) |
[inline] |
Definition at line 714 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::at_first", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::at_first", ABORT, NULL);
#endif
return ((list->empty ()) || (current == list->First ()) || ((current == NULL) &&
(prev == list->last) &&
!ex_current_was_last));
}
bool ELIST_ITERATOR::at_last |
( |
| ) |
[inline] |
Definition at line 736 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::at_last", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::at_last", ABORT, NULL);
#endif
return ((list->empty ()) || (current == list->last) || ((current == NULL) &&
(prev == list->last) &&
ex_current_was_last));
}
bool ELIST_ITERATOR::current_extracted |
( |
| ) |
[inline] |
bool ELIST_ITERATOR::cycled_list |
( |
| ) |
[inline] |
Definition at line 259 of file elst.cpp.
{
ELIST_LINK *ptr;
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::data_relative", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::data_relative", ABORT, NULL);
if (list->empty ())
EMPTY_LIST.error ("ELIST_ITERATOR::data_relative", ABORT, NULL);
if (offset < -1)
BAD_PARAMETER.error ("ELIST_ITERATOR::data_relative", ABORT,
"offset < -l");
#endif
if (offset == -1)
ptr = prev;
else
for (ptr = current ? current : prev; offset-- > 0; ptr = ptr->next);
#ifndef NDEBUG
if (!ptr)
NULL_DATA.error ("ELIST_ITERATOR::data_relative", ABORT, NULL);
#endif
return ptr;
}
bool ELIST_ITERATOR::empty |
( |
| ) |
[inline] |
Definition at line 322 of file elst.cpp.
{
const ERRCODE DONT_EXCHANGE_DELETED =
"Can't exchange deleted elements of lists";
ELIST_LINK *old_current;
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::exchange", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::exchange", ABORT, NULL);
if (!other_it)
BAD_PARAMETER.error ("ELIST_ITERATOR::exchange", ABORT, "other_it NULL");
if (!(other_it->list))
NO_LIST.error ("ELIST_ITERATOR::exchange", ABORT, "other_it");
#endif
if ((list->empty ()) ||
(other_it->list->empty ()) || (current == other_it->current))
return;
if (!current || !other_it->current)
DONT_EXCHANGE_DELETED.error ("ELIST_ITERATOR.exchange", ABORT, NULL);
if ((next == other_it->current) ||
(other_it->next == current)) {
if ((next == other_it->current) &&
(other_it->next == current)) {
prev = next = current;
other_it->prev = other_it->next = other_it->current;
}
else {
if (other_it->next == current) {
other_it->prev->next = current;
other_it->current->next = next;
current->next = other_it->current;
other_it->next = other_it->current;
prev = current;
}
else {
prev->next = other_it->current;
current->next = other_it->next;
other_it->current->next = current;
next = current;
other_it->prev = other_it->current;
}
}
}
else {
prev->next = other_it->current;
current->next = other_it->next;
other_it->prev->next = current;
other_it->current->next = next;
}
if (list->last == current)
list->last = other_it->current;
if (other_it->list->last == other_it->current)
other_it->list->last = current;
if (current == cycle_pt)
cycle_pt = other_it->cycle_pt;
if (other_it->current == other_it->cycle_pt)
other_it->cycle_pt = cycle_pt;
old_current = current;
current = other_it->current;
other_it->current = old_current;
}
Definition at line 622 of file elst.h.
{
ELIST_LINK *extracted_link;
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::extract", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::extract", ABORT, NULL);
if (!current)
NULL_CURRENT.error ("ELIST_ITERATOR::extract",
ABORT, NULL);
#endif
if (list->singleton()) {
prev = next = list->last = NULL;
} else {
prev->next = next;
if (current == list->last) {
list->last = prev;
ex_current_was_last = TRUE;
} else {
ex_current_was_last = FALSE;
}
}
ex_current_was_cycle_pt = (current == cycle_pt) ? TRUE : FALSE;
extracted_link = current;
extracted_link->next = NULL;
current = NULL;
return extracted_link;
}
Definition at line 217 of file elst.cpp.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::forward", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::forward", ABORT, NULL);
#endif
if (list->empty ())
return NULL;
if (current) {
prev = current;
started_cycling = TRUE;
current = current->next;
} else {
if (ex_current_was_cycle_pt)
cycle_pt = next;
current = next;
}
next = current->next;
#ifndef NDEBUG
if (!current)
NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, NULL);
if (!next)
NULL_NEXT.error ("ELIST_ITERATOR::forward", ABORT,
"This is: %p Current is: %p", this, current);
#endif
return current;
}
inT32 ELIST_ITERATOR::length |
( |
| ) |
[inline] |
void ELIST_ITERATOR::mark_cycle_pt |
( |
| ) |
[inline] |
ELIST_LINK * ELIST_ITERATOR::move_to_first |
( |
| ) |
[inline] |
Definition at line 665 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::move_to_first", ABORT, NULL);
if (!list)
NO_LIST.error ("ELIST_ITERATOR::move_to_first", ABORT, NULL);
#endif
current = list->First ();
prev = list->last;
next = current ? current->next : NULL;
return current;
}
void ELIST_ITERATOR::set_to_list |
( |
ELIST * |
list_to_iterate | ) |
[inline] |
Definition at line 299 of file elst.h.
{
#ifndef NDEBUG
if (!this)
NULL_OBJECT.error ("ELIST_ITERATOR::set_to_list", ABORT, NULL);
if (!list_to_iterate)
BAD_PARAMETER.error ("ELIST_ITERATOR::set_to_list", ABORT,
"list_to_iterate is NULL");
#endif
list = list_to_iterate;
prev = list->last;
current = list->First ();
next = current ? current->next : NULL;
cycle_pt = NULL;
started_cycling = FALSE;
ex_current_was_last = FALSE;
ex_current_was_cycle_pt = FALSE;
}
void ELIST_ITERATOR::sort |
( |
int |
comparatorconst void *, const void * | ) |
[inline] |
Friends And Related Function Documentation
The documentation for this class was generated from the following files: