Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <>>
Public Member Functions | |
SLList (void) | |
SLNode * | first (void) const |
SLNode * | last (void) const |
int | count (void) const |
bool | isEmpty (void) const |
void | addFirst (SLNode *node) |
void | addLast (SLNode *node) |
void | removeFirst (void) |
void | removeLast (void) |
This class implements a single-link list data structure with nodes (SLNode) that must be extended to contain useful information.
Add a node at the first position in the list.
node | Node to add. |
Referenced by List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::addFirst(), and SLList::addLast().
Add a node to the end of the list.
node | Node to add at the last position of the list. Remark that this method is really inefficient.bIts working time is in O(n), n number of nodes in the list. Use it only with small list or revert to more powerful data structures. |
References SLList::addFirst(), SLNode::insertAfter(), and SLList::last().
Referenced by List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::addLast().
int count | ( | void | ) | const |
Count the nodes in the list.
References SLNode::next().
Referenced by List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::count().
Get te first node of the list.
Test if the list is empty.
Referenced by List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::clear(), and List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::isEmpty().
Get te first node of the list. Remark that this method is really inefficient. Its working time is in O(n), n number of nodes in the list. Use it only with small list or revert to more powerful data structures.
References SLNode::next().
Referenced by SLList::addLast().
Remove the first node of the list.
References SLNode::next().
Referenced by List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::clear(), and List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::removeFirst().
Remove the last node of the list.
References SLNode::next(), and SLNode::removeNext().
Referenced by List< Pair< K, T >, CompareEquiv< AssocComparator< K, T, Comparator< K > > >, DefaultAlloc >::removeLast().