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::SLList Class Reference

#include <>>

Public Member Functions

 SLList (void)
 
SLNodefirst (void) const
 
SLNodelast (void) const
 
int count (void) const
 
bool isEmpty (void) const
 
void addFirst (SLNode *node)
 
void addLast (SLNode *node)
 
void removeFirst (void)
 
void removeLast (void)
 

Detailed Description

This class implements a single-link list data structure with nodes (SLNode) that must be extended to contain useful information.

Constructor & Destructor Documentation

elm::inhstruct::SLList::SLList ( void  )

Member Function Documentation

void elm::inhstruct::SLList::addFirst ( SLNode node)

Add a node at the first position in the list.

Parameters
nodeNode to add.
Warning
It is an error to add the same nodes many times to one or to many lists.
It is an error to call this method on an empty list.

Referenced by elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::addFirst(), and addLast().

void elm::inhstruct::SLList::addLast ( SLNode node)

Add a node to the end of the list.

Parameters
nodeNode 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.
Warning
It is an error to add the same nodes many times to one or to many lists.

References addFirst(), elm::inhstruct::SLNode::insertAfter(), and last().

Referenced by elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::addLast().

int elm::inhstruct::SLList::count ( void  ) const
SLNode * elm::inhstruct::SLList::first ( void  ) const

Get te first node of the list.

Returns
First list node.
Warning
It is an error to call this method on an empty list.
SLNode * elm::inhstruct::SLList::last ( void  ) const

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.

Returns
Last list node.

References elm::inhstruct::SLNode::next().

Referenced by addLast().

void elm::inhstruct::SLList::removeLast ( void  )

Remove the last node of the list.

Warning
Remark that this method is really inefficient. If you have to perform this task too often, please revert to other data structure.

References elm::inhstruct::SLNode::next(), and elm::inhstruct::SLNode::removeNext().

Referenced by elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::removeLast().


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