General information:Author: klaasje Version: 1.0 Date: Wed Oct 20 9:03:04 MET 1999 |
Header files:
|
Code files:
|
Template class DL_List class is the base class for implementing a double linked list. The Root node marks the begining and end of the list. The lists consists of nodes double linked with a next and previous pointer DL_Node The nodes are cyclic connected to the root node. The list is meant to be used with an iterator class, to traverse the nodes. More then 1 iterator can be attached to the list. The list keeps track of the number of iterators that are attached to it. Depending on this certain operations are allowed are not. For instance a node can only be deleted if there is only one iterator attached to the list. class
Dtype
Object contaning List Nodes
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: NONE |
Declaration:
DL_List()
Description:
!ConstructorConstruct a list object!tcarg class
Dtype
list object
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: NONE |
Declaration:
~DL_List()
Description:
destructor
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: void |
Declaration:
void Error(char* function,Lerror a_error)
Parameters:
function : function string that generated this error
a_error : error code to generate a message for
Description:
Report off List Errors
scope: public | purpose: normal | inline?: yes | function property: standard | type: basic | typename: int |
Declaration:
int count()
Description:
Number of items in the list
scope: public | purpose: normal | inline?: yes | function property: standard | type: basic | typename: G_BOOL |
Declaration:
G_BOOL empty()
Description:
Empty List?
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: void |
Declaration:
void insend(Dtype n)
Parameters:
n : an object for which the template list was generated
Description:
insert the object given at the end of the list, after tail
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: void |
Declaration:
void insbegin(Dtype n)
Parameters:
n : an object for which the template list was generated
Description:
insert the object given at the begin of the list, before head
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: void |
Declaration:
void removehead()
Description:
remove the object at the begin of the list (head)
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: void |
Declaration:
void removetail()
Description:
remove the object at the end of the list (tail)
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: void |
Declaration:
void remove_all()
Description:
remove all objects from the list
scope: public | purpose: normal | inline?: yes | function property: standard | type: basic | typename: Dtype |
Declaration:
Dtype headitem()
Return value:
Dtype: returns the object at the head of the list
Description:
Get the item at the head of the list
scope: public | purpose: normal | inline?: yes | function property: standard | type: basic | typename: Dtype |
Declaration:
Dtype tailitem()
Return value:
Dtype: returns the object at the tail of the list
Description:
Get the item at the tail of the list
scope: public | purpose: normal | inline?: no | function property: standard | type: basic | typename: void |
Declaration:
void takeover(DL_List<Dtype>* otherlist)
Parameters:
otherlist : the list to take the items from
Description:
to move all objects in a list to this list.
Comments:
The iterator level must be zero to be able to use this function, else an error will be generated
The list may not be the same list as this list
scope: public | type: basic | typename: DL_Node<Dtype>* |
Declaration:
DL_Node<Dtype>* _root
Description:
the root node pointer of the list, the first and last node in the list are connected to the root node. The root node is used to detect the end / beginning of the list while traversing it.
scope: public | type: basic | typename: int |
Declaration:
int _nbitems
Description:
the number of items in the list, if empty list it is 0
scope: public | type: basic | typename: short int |
Declaration:
short int _iterlevel
Description:
number of iterators on the list, Attaching or instantiating an iterator to list, will increment this member, detaching and destruction of iterator for a list will decrement this number