LibTrace

Programming - The List class

The "List" class is simply a linked list class that many other classes are derived from.
List::List(List *p)

void List::set_parent(List *p)
void List::set_child(List *p)
List* List::get_parent(void)
List* List::get_child(void)

List* List::find_head(void)
List* List::find_tail(void)
void List::unlink(void)
int List::members(void)
void List::full_dump(void)

void merge(List *a, List *b)
void destroy_list(List *l)



List::List(List *p)
This constructor sets the parent to be "p".
void List::set_parent(List *p)
This sets the new parent to be "p" and the new parent is notified about its new child.
void List::set_child(List *p)
This sets the new child to be "p" and the new child is notfied about it's new parent.
List* List::get_parent(void)
This returns the parent.
List* List::get_child(void)
This returns the child.
List* List::find_head(void)
This function finds the very first item in the list.
List* List::find_tail(void)
This function finds the very last item in the list.
void List::unlink(void)
This function removes this item from the list and patches up the hole left behind.
int List::members(void)
This function returns the total number of items in the list.
void List::full_dump(void)
This function outputs details of this item to "cout".
void merge(List *a, List *b)
This function will link together the two lists. Be carefull not to try to merge two items which are already on the same list. Any item in each list can be passed to this function as it links the head of one to the tail of the other.
void destroy_list(List *l)
This function will delete all the items in the entire list