Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::inhstruct::DLList Class Reference

#include <>>

Public Member Functions

 DLList (void)
 
 DLList (DLList &list)
 
DLNodefirst (void) const
 
DLNodelast (void) const
 
bool isEmpty (void) const
 
int count (void) const
 
void addFirst (DLNode *node)
 
void addLast (DLNode *node)
 
void removeFirst (void)
 
void removeLast (void)
 

Detailed Description

This class implements a double-linked list using node inherited from the user.

Constructor & Destructor Documentation

elm::inhstruct::DLList::DLList ( void  )

Build an empty list.

elm::inhstruct::DLList::DLList ( DLList list)

References isEmpty().

Member Function Documentation

void elm::inhstruct::DLList::addFirst ( DLNode node)

Add a node as the first node in the list.

Parameters
nodeNode to add.

References elm::inhstruct::DLNode::insertAfter().

void elm::inhstruct::DLList::addLast ( DLNode node)

Add a node as the last node in the list.

Parameters
nodeNode to add.

References elm::inhstruct::DLNode::insertBefore().

int elm::inhstruct::DLList::count ( void  ) const

Count the number of nodes in the list.

Returns
Number of nodes.
DLNode * elm::inhstruct::DLList::first ( void  ) const

Get the first node in the list.

Returns
First node. If the list is empty, return the end marker.
bool elm::inhstruct::DLList::isEmpty ( void  ) const

Test if the list is empty.

Returns
True if the list is empty, false else.

Referenced by DLList(), removeFirst(), and removeLast().

DLNode * elm::inhstruct::DLList::last ( void  ) const

Get the last node in the list.

Returns
Last node. If the list is empty, return the begin marker.
void elm::inhstruct::DLList::removeFirst ( void  )

Remove the first node of the list. Does not perform the deletion of the node. It is an error to call this method when the list is empty.

References isEmpty(), and elm::inhstruct::DLNode::removeNext().

void elm::inhstruct::DLList::removeLast ( void  )

Remove the last node of the list. Does not perform the deletion of the node. It is an error to call this method when the list is empty.

References isEmpty(), and elm::inhstruct::DLNode::removePrevious().


The documentation for this class was generated from the following files: