![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/data/SortedList.h>
Classes | |
class | Iter |
Public Types | |
typedef T | t |
typedef SortedList< T, C, A > | self_t |
Public Member Functions | |
SortedList (void) | |
SortedList (const SortedList< T, C, A > &l) | |
C & | comparator () |
const C & | comparator () const |
A & | allocator () |
void | removeFirst (void) |
void | removeLast (void) |
int | count (void) const |
bool | contains (const T &item) const |
template<class CC > | |
bool | containsAll (const CC &c) const |
bool | isEmpty (void) const |
operator bool (void) const | |
Iter | items (void) const |
Iter | operator* (void) const |
operator Iter (void) const | |
Iter | begin (void) const |
Iter | end (void) const |
bool | equals (const SortedList< T > &l) const |
bool | operator== (const SortedList< T > &l) const |
bool | operator!= (const SortedList< T > &l) const |
void | clear (void) |
void | copy (const SortedList< T > &l) |
void | add (const T &value) |
template<class CC > | |
void | addAll (const CC &c) |
void | remove (const T &item) |
template<class CC > | |
void | removeAll (const CC &c) |
void | remove (const Iter &iter) |
SortedList< T > & | operator+= (const T &v) |
SortedList< T > & | operator-= (const T &v) |
const T & | first (void) const |
const T & | last (void) const |
Iter | find (const T &item, const Iter &iter) const |
Iter | find (const T &item) const |
T & | at (const Iter &i) |
Iter | nth (int n) const |
SortedList< T, C > & | operator= (const SortedList< T, C > &sl) |
bool | operator& (const T &e) const |
T & | operator[] (int k) |
const T & | operator[] (int k) const |
Protected Types | |
typedef List< T, CompareEquiv< C >, A > | list_t |
Protected Member Functions | |
void | set (Iter i, const T &val) |
Protected Attributes | |
list_t | list |
This class provides a sorted list implementation using single-link lists (List). Elements are sorted in increasing order of the used comparator.
Its performances are not very good but the memory footprint is very low. Use it only for small collection of elements.
T | Type of data stored in the list. |
A | Adapter to access key part (must implement concept elm::concept::Adapter). |
C | Comparator of the stored items (must implement the concept elm::concept::Comparator). |
|
protected |
typedef SortedList<T, C, A> self_t |
typedef T t |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::add(), ListSet< T, C, A >::diff(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::equals(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::find(), ListSet< T, C, A >::join(), ListSet< T, C, A >::meet(), and ListSet< T, C, A >::subsetOf().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Count the items in the list.
Referenced by ListMap< string, Section * >::count().
|
inline |
Referenced by ListMap< string, Section * >::equals(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator!=(), and SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator==().
|
inline |
|
inline |
Get the first item of the list.
Test if the list is empty.
Referenced by ListMap< string, Section * >::isEmpty().
Referenced by SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::begin(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator Iter(), and SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator*().
|
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 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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. |
Referenced by SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator-=(), ListSet< T, C, A >::operator-=(), and ListMap< string, Section * >::remove().
|
inline |
Remove the first item from the list.
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 ListMap< string, Section * >::put().
|
protected |
Referenced by SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::add(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::addAll(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::allocator(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::at(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::clear(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::comparator(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::copy(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::count(), ListSet< T, C, A >::diff(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::first(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::isEmpty(), ListSet< T, C, A >::join(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::last(), ListSet< T, C, A >::meet(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator bool(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator&(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator=(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::operator[](), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::remove(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::removeAll(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::removeFirst(), SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::removeLast(), and SortedList< Pair< string, Section * >, AssocComparator< string, Section *, Comparator< string > >, DefaultAlloc >::set().