Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
DLList Class Reference

#include <>>

Public Member Functions

 DLList (void)
 
 DLList (DLList &list)
 
DLNodefirst (void) const
 
DLNodelast (void) const
 
bool isEmpty (void) const
 
DLNodehead (void) const
 
DLNodetail (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

◆ DLList() [1/2]

DLList ( void  )
inline

Build an empty list.

◆ DLList() [2/2]

DLList ( DLList list)
inline

References elm::io::list().

Member Function Documentation

◆ addFirst()

void addFirst ( DLNode node)
inline

Add an item at the first position.

Parameters
itemItem to add.

Add a node as the first node in the list.

Parameters
nodeNode to add.

References DLNode::insertAfter().

Referenced by BiDiList< T, E, A >::addFirst(), and Temp::Temp().

◆ addLast()

void addLast ( DLNode node)
inline

Add an item at the last position.

Parameters
itemItem to add.

Add a node as the last node in the list.

Parameters
nodeNode to add.

References DLNode::insertBefore().

Referenced by BiDiList< T, E, A >::addLast().

◆ count()

int count ( void  ) const
inline

Count the items in the list.

Returns
Item count.

Count the number of nodes in the list.

Returns
Number of nodes.

Referenced by BiDiList< T, E, A >::count().

◆ first()

DLNode * first ( void  ) const
inline

Get the first item of the list.

Returns
First item.
Warning
It is an error to call this method on an empty list.

Get the first node in the list.

Returns
First node. If the list is empty, return the end marker.

Referenced by BiDiList< T, E, A >::clear(), SimpleGC::doGC(), BiDiList< T, E, A >::first(), BiDiList< T, E, A >::last(), and BiDiList< T, E, A >::removeFirst().

◆ head()

DLNode* head ( void  ) const
inline

◆ isEmpty()

bool isEmpty ( void  ) const
inline

Test if the list is empty.

Returns
True if the list is empty, false else.

Referenced by BiDiList< T, E, A >::clear(), BiDiList< T, E, A >::isEmpty(), DLList::removeFirst(), and DLList::removeLast().

◆ last()

DLNode * last ( void  ) const
inline

Get the last item of the list.

Returns
Last item.
Warning
It is an error to call this method on an empty list.

Get the last node in the list.

Returns
Last node. If the list is empty, return the begin marker.

Referenced by BiDiList< T, E, A >::last(), and BiDiList< T, E, A >::removeLast().

◆ removeFirst()

void removeFirst ( void  )
inline

Remove the first item from the list.

Warning
It is an error to call this method on empty list.

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 DLList::isEmpty(), and DLNode::removeNext().

Referenced by BiDiList< T, E, A >::clear(), and BiDiList< T, E, A >::removeFirst().

◆ removeLast()

void removeLast ( void  )
inline

Remove the last item from the list.

Warning
It is an error to call this method on empty list.

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 DLList::isEmpty(), and DLNode::removePrevious().

Referenced by BiDiList< T, E, A >::removeLast().

◆ tail()

DLNode* tail ( void  ) const
inline

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