Go to the first, previous, next, last section, table of contents.


CNDLList -- Doubly Linked List of Objects

SYNOPSIS

#include <CNCL/DLList.h>

TYPE

CN_DLLIST

BASE CLASSES

CNSLList

DERIVED CLASSES

None

RELATED CLASSES

CNDLObject, CNDLIterator

DESCRIPTION

CNDLList is a doubly linked list that can contain any CNCL compatible object.

Constructors:

CNDLList();
CNDLList(CNParam *param);
Initializes the list to empty state. Please note, that there is NO copy constructor supplied. Any attempt to copy a CNDLList will yield a fatal error.

Destructors:

~CNDLList();
Deletes the linked list and all CNDLObject nodes. It does NOT delete the objects referenced by the nodes.

In addition to the member functions required by CNCL and to the functions supplied by CNSLList, CNDLList provides or defines more efficiently:

CNDLObject *last() const;
Returns the last node in the list or NIL if the list is empty.
CNDLObject *prev(CNDLObject *link) const;
Returns the previous node in the list, where link points to the current node. This may be NIL if the previous node doesn't exist.
CNDLObject *append(CNObject *obj);
CNDLObject *append(CNObject &obj);
Adds a new node to the end of the list, referencing the object obj. It returns the node allocated for the object.
CNDLObject *append(CNDLObject *obj);
Adds an already allocated node to the list. It returns the pointer obj.
CNDLObject *insert_before(CNDLObject *pos, CNObject *obj);
CNDLObject *insert_before(CNDLObject *pos, CNObject &obj);
Creates a new node for obj and inserts it into the list before node pos. It returns the new node.
CNDLObject *insert_before(CNDLObject *pos, CNDLObject *obj);
Inserts an already allocated node into the list before node pos. It returns obj.
bool ok();
Checks the list for consistency. It returns TRUE, if the list is o.k.


Go to the first, previous, next, last section, table of contents.