![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/data/List.h>
Inheritance diagram for List< T, E, A >:Classes | |
| class | Iter |
| class | PrecIter |
| class | SubIter |
Public Member Functions | |
| List () | |
| List (const List< T, E, A > &list) | |
| ~List (void) | |
| E & | equivalence () |
| const E & | equivalence () const |
| A & | allocator () |
| void | copy (const List< T, E, A > &list) |
| Iter | items (void) const |
| Iter | operator* (void) const |
| operator Iter (void) const | |
| Iter | begin (void) const |
| Iter | end (void) const |
| int | count (void) const |
| bool | contains (const T &item) const |
| bool | isEmpty (void) const |
| operator bool (void) const | |
| bool | equals (const List< T > &l) const |
| const T & | at (const Iter &i) 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) |
| T & | at (const Iter &i) |
| void | remove (PrecIter &iter) |
| T & | first (void) |
| const T & | first (void) const |
| T & | last (void) |
| const T & | last (void) const |
| T & | nth (int n) |
| const T & | nth (int n) const |
| Iter | find (const T &item) const |
| Iter | find (const T &item, const Iter &pos) const |
| void | addFirst (const T &value) |
| void | addLast (const T &value) |
| void | addAfter (const Iter &pos, const T &value) |
| void | addBefore (PrecIter &pos, const T &value) |
| void | removeFirst (void) |
| void | removeLast (void) |
| void | set (const Iter &pos, const T &item) |
| const T & | top (void) const |
| T | pop (void) |
| void | push (const T &i) |
| void | reset (void) |
| List & | operator= (const List &list) |
| bool | operator& (const T &e) const |
| T & | operator[] (int k) |
| const T & | operator[] (int k) const |
| bool | operator== (const List< T > &l) const |
| bool | operator!= (const List< T > &l) const |
| List< T > & | operator+= (const T &h) |
| List< T > & | operator+= (const List< T > &l) |
| List< T > & | operator-= (const T &h) |
| List< T > & | operator-= (const List< T > &l) |
Public Member Functions inherited from Equiv< T > | |
| bool | isEqual (const T &v1, const T &v2) const |
Public Member Functions inherited from DefaultAllocatorDelegate | |
| t::ptr | allocate (t::size size) const |
| void | free (t::ptr p) const |
| template<class T > | |
| T * | alloc () const |
Static Public Attributes | |
| static List< T, E, A > | null |
Static Public Attributes inherited from Equiv< T > | |
| static Equiv< T > | def |
Additional Inherited Members | |
Public Types inherited from Equiv< T > | |
| typedef T | t |
Static Public Member Functions inherited from Equiv< T > | |
| static bool | equals (const T &v1, const T &v2) |
This class provides a generic implementation of single-link lists.
| T | Type of data stored in the list. |
| M | Manager supporting equivallence and allocation. |
|
inline |
References List< T, E, A >::copy(), and elm::io::list().
References List< T, E, A >::clear().
|
inline |
Add an item to the list. In fact, alias for addFirst().
| value | Value to add. |
References List< T, E, A >::addFirst().
Referenced by CleanList::add(), List< T, E, A >::addAll(), HashSet< T, H, A >::meet(), and List< T, E, A >::operator+=().
|
inline |
References List< T, E, A >::add(), and List< T, E, A >::items().
Referenced by SortedList< T, C, A >::addAll(), and List< T, E, A >::operator+=().
Add item before the element pointer by pos.
| pos | Iterator pointing the element to add before. |
| value | Value to add. |
References List< T, E, A >::addFirst().
Referenced by SortedList< T, C, A >::add(), and ListSet< T, C, A >::join().
|
inline |
Add the given item at the first position in the list.
| item | Item to add. |
References SLList::addFirst().
Referenced by List< T, E, A >::add(), List< T, E, A >::addBefore(), List< T, E, A >::copy(), and List< T, E, A >::push().
|
inline |
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. |
References SLList::addLast().
Referenced by SortedList< T, C, A >::add().
|
inline |
Referenced by SortedList< T, C, A >::allocator().
|
inline |
|
inline |
Referenced by SortedList< T, C, A >::at().
References List< T, E, A >::items().
References SLList::isEmpty(), and SLList::removeFirst().
Referenced by List< T, E, A >::~List(), CleanList::clean(), SortedList< T, C, A >::clear(), List< T, E, A >::copy(), and List< T, E, A >::reset().
|
inline |
Test if an item is in the list.
| item | Item to look for. |
References elm::iter().
Referenced by List< T, E, A >::operator&(), and SortedList< T, C, A >::operator&().
Copy the given list in the current list (removing the previous items of the current list).
| list | List to copy in. |
References List< T, E, A >::addFirst(), List< T, E, A >::clear(), and elm::io::list().
Referenced by List< T, E, A >::List(), SortedList< T, C, A >::copy(), List< T, E, A >::operator=(), and SortedList< T, C, A >::operator=().
|
inline |
Count the items in the list.
References SLList::count().
Referenced by SortedList< T, C, A >::count().
|
inline |
Get an iterator on the end of the list.
Test if both lists are equal.
| l | List to compare with. |
Referenced by List< T, E, A >::operator!=(), and List< T, E, A >::operator==().
|
inline |
Referenced by SortedList< T, C, A >::comparator().
|
inline |
|
inline |
Find an element in the list.
| item | Element to look for. |
References List< T, E, A >::items().
|
inline |
Referenced by SortedList< T, C, A >::first(), List< T, E, A >::pop(), List< T, E, A >::remove(), and List< T, E, A >::top().
|
inline |
Get the first item of the list.
Test if the list is empty.
References SLList::isEmpty().
Referenced by SortedList< T, C, A >::isEmpty(), List< T, E, A >::operator bool(), SortedList< T, C, A >::operator bool(), and List< T, E, A >::remove().
|
inline |
Referenced by SortedList< T, C, A >::last().
|
inline |
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.
|
inline |
Referenced by List< T, E, A >::operator[]().
|
inline |
References List< T, E, A >::isEmpty().
References List< T, E, A >::items().
References List< T, E, A >::equals().
|
inline |
References List< T, E, A >::contains().
References List< T, E, A >::items().
References List< T, E, A >::addAll().
|
inline |
References List< T, E, A >::add().
References List< T, E, A >::removeAll().
|
inline |
References List< T, E, A >::remove().
References List< T, E, A >::copy(), and elm::io::list().
References List< T, E, A >::equals().
|
inline |
References List< T, E, A >::nth().
|
inline |
References List< T, E, A >::nth().
|
inline |
References List< T, E, A >::first(), and List< T, E, A >::removeFirst().
|
inline |
References List< T, E, A >::addFirst().
|
inline |
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. |
References List< T, E, A >::first(), List< T, E, A >::isEmpty(), and List< T, E, A >::removeFirst().
Referenced by ListSet< T, C, A >::diff(), ListSet< T, C, A >::meet(), List< T, E, A >::operator-=(), SortedList< T, C, A >::remove(), and List< T, E, A >::removeAll().
References List< T, E, A >::remove().
Referenced by List< T, E, A >::remove().
|
inline |
References List< T, E, A >::items(), and List< T, E, A >::remove().
Referenced by List< T, E, A >::operator-=(), and SortedList< T, C, A >::removeAll().
Remove the first item from the list.
References SLList::removeFirst().
Referenced by List< T, E, A >::pop(), List< T, E, A >::remove(), and SortedList< T, C, A >::removeFirst().
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.
References SLList::removeLast().
Referenced by SortedList< T, C, A >::removeLast().
References List< T, E, A >::clear().
change the value of an element of the list.
| pos | Iterator on the element to set. |
| item | Value to set. |
Referenced by SortedList< T, C, A >::set().
|
inline |
References List< T, E, A >::first().
|
static |