Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/genstruct/SLList.h>
Classes | |
class | Iterator |
class | MutableIterator |
Public Member Functions | |
SLList (void) | |
SLList (const SLList &list) | |
SLList & | operator= (const SLList &list) |
~SLList (void) | |
void | copy (const SLList< T > &list) |
int | count (void) const |
bool | contains (const T &item) const |
bool | isEmpty (void) const |
operator bool (void) const | |
void | clear (void) |
void | add (const T &value) |
template<class C > | |
void | addAll (const C &items) |
template<class C > | |
void | removeAll (const C &items) |
void | remove (const T &value) |
void | remove (Iterator &iter) |
void | remove (MutableIterator &iter) |
T & | first (void) |
const T & | first (void) const |
T & | last (void) |
const T & | last (void) const |
Iterator | find (const T &item) const |
Iterator | find (const T &item, const Iterator &pos) const |
void | addFirst (const T &value) |
void | addLast (const T &value) |
void | addAfter (const Iterator &pos, const T &value) |
void | addBefore (const Iterator &pos, const T &value) |
void | removeFirst (void) |
void | removeLast (void) |
void | set (const Iterator &pos, const T &item) |
const T & | top (void) const |
T | pop (void) |
void | push (const T &i) |
void | reset (void) |
SLList< T > & | operator+= (const T &h) |
SLList< T > & | operator+= (const SLList< T > &l) |
Static Public Attributes | |
static SLList< T, E > | null |
This class provides a generic implementation of single-link lists.
T | Type of data stored in the list. |
E | Equivallence class to compare items of the list. |
elm::genstruct::SLList< T, E >::SLList | ( | void | ) |
elm::genstruct::SLList< T, E >::SLList | ( | const SLList< T, E > & | list | ) |
elm::genstruct::SLList< T, E >::~SLList | ( | void | ) |
void elm::genstruct::SLList< T, E >::add | ( | const T & | value | ) |
Add an item to the list. In fact, alias for addFirst().
value | Value to add. |
Referenced by elm::CleanList::add(), and elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::addAll().
void elm::genstruct::SLList< T, E >::addAfter | ( | const Iterator & | pos, |
const T & | value | ||
) |
Add an item after the one pointed by pos.
pos | Iterator pointing the element to add after. |
value | Value to add. |
void elm::genstruct::SLList< T, E >::addAll | ( | const C & | items | ) |
void elm::genstruct::SLList< T, E >::addBefore | ( | const Iterator & | pos, |
const T & | value | ||
) |
Add item before the element pointer by pos.
pos | Iterator pointing the element to add before. |
value | Value to add. |
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::add().
void elm::genstruct::SLList< T, E >::addFirst | ( | const T & | item | ) |
Add the given item at the first position in the list.
item | Item to add. |
Referenced by elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::add(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::addBefore(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::copy(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::operator+=(), and elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::push().
void elm::genstruct::SLList< T, E >::addLast | ( | const T & | item | ) |
Add the given item at the last position in 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.
item | Item to add. |
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::add().
void elm::genstruct::SLList< T, E >::clear | ( | void | ) |
Referenced by elm::CleanList::clean(), elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::clear(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::copy(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::reset(), and elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::~SLList().
bool elm::genstruct::SLList< T, E >::contains | ( | const T & | item | ) | const |
Test if an item is in the list.
item | Item to look for. |
void elm::genstruct::SLList< T, E >::copy | ( | const SLList< T > & | list | ) |
Copy the given list in the current list (removing the previous items of the current list).
list | List to copy in. |
Referenced by elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::operator=(), and elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::SLList().
int elm::genstruct::SLList< T, E >::count | ( | void | ) | const |
Count the items in the list.
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::count().
Iterator elm::genstruct::SLList< T, E >::find | ( | const T & | item | ) | const |
Find an element in the list.
item | Element to look for. |
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::find().
Iterator elm::genstruct::SLList< T, E >::find | ( | const T & | item, |
const Iterator & | pos | ||
) | const |
Find an element in the list from the given position.
item | Element to look for. |
pos | Position to look from. |
T& elm::genstruct::SLList< T, E >::first | ( | void | ) |
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::first(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::pop(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::remove(), and elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::top().
const T & elm::genstruct::SLList< T, E >::first | ( | void | ) | const |
Get the first item of the list.
bool elm::genstruct::SLList< T, E >::isEmpty | ( | void | ) | const |
Test if the list is empty.
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::isEmpty(), elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::operator bool(), and elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::operator bool().
T& elm::genstruct::SLList< T, E >::last | ( | void | ) |
const T & elm::genstruct::SLList< T, E >::last | ( | void | ) | const |
Get the last item 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.
elm::genstruct::SLList< T, E >::operator bool | ( | void | ) | const |
SLList<T>& elm::genstruct::SLList< T, E >::operator+= | ( | const T & | h | ) |
SLList<T>& elm::genstruct::SLList< T, E >::operator+= | ( | const SLList< T > & | l | ) |
SLList& elm::genstruct::SLList< T, E >::operator= | ( | const SLList< T, E > & | list | ) |
T elm::genstruct::SLList< T, E >::pop | ( | void | ) |
void elm::genstruct::SLList< T, E >::push | ( | const T & | i | ) |
void elm::genstruct::SLList< T, E >::remove | ( | const T & | item | ) |
Remove the given item from the list or just one if the list contains many items equals to the given one. The item type T must support the equality / inequality operators.
item | Item to remove. |
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::remove().
void elm::genstruct::SLList< T, E >::remove | ( | Iterator & | iter | ) |
Remove the item pointed by the iterator. After this call, the iterator points to the next item (if any).
iter | Iterator pointing the item to remove. |
void elm::genstruct::SLList< T, E >::remove | ( | MutableIterator & | iter | ) |
void elm::genstruct::SLList< T, E >::removeAll | ( | const C & | items | ) |
void elm::genstruct::SLList< T, E >::removeFirst | ( | void | ) |
Remove the first item from the list.
Referenced by elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::pop(), elm::genstruct::SLList< pair_t, CompareEquiv< pair_t, DelegateComparator< pair_t, AssocComparator< string, string, C > > > >::remove(), and elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::removeFirst().
void elm::genstruct::SLList< T, E >::removeLast | ( | void | ) |
Remove the last item from 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.
Referenced by elm::SortedList< pair_t, DelegateComparator< pair_t, AssocComparator< string, Section *, C > > >::removeLast().
void elm::genstruct::SLList< T, E >::reset | ( | void | ) |
void elm::genstruct::SLList< T, E >::set | ( | const Iterator & | pos, |
const T & | item | ||
) |
change the value of an element of the list.
pos | Iterator on the element to set. |
item | Value to set. |
const T& elm::genstruct::SLList< T, E >::top | ( | void | ) | const |
|
static |