![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/data/ListSet.h>
Public Types | |
typedef T | t |
typedef ListSet< T, C, A > | self_t |
![]() | |
typedef T | t |
typedef SortedList< T, Comparator< T >, DefaultAlloc > | self_t |
Public Member Functions | |
ListSet (void) | |
ListSet (const ListSet< T, C > &set) | |
void | insert (const T &v) |
bool | subsetOf (const SortedList< T > &l) const |
bool | operator<= (const SortedList< T > &l) const |
bool | operator< (const SortedList< T > &l) const |
bool | operator>= (const SortedList< T > &l) const |
bool | operator> (const SortedList< T > &l) const |
void | join (const self_t &set) |
void | meet (const self_t &set) |
void | diff (const self_t &set) |
self_t & | operator+= (const self_t &set) |
self_t & | operator|= (const self_t &set) |
self_t & | operator*= (const self_t &set) |
self_t & | operator&= (const self_t &set) |
self_t & | operator-= (const self_t &set) |
self_t & | operator+ (const self_t &set) |
self_t & | operator| (const self_t &set) |
self_t & | operator* (const self_t &set) |
self_t & | operator& (const self_t &set) |
self_t & | operator- (const self_t &set) |
void | add (const T &v) |
self_t & | operator+= (const T &val) |
self_t & | operator-= (const T &val) |
![]() | |
SortedList (void) | |
SortedList (const SortedList< T, Comparator< T >, DefaultAlloc > &l) | |
Comparator< T > & | comparator () |
const Comparator< T > & | comparator () const |
DefaultAlloc & | allocator () |
void | removeFirst (void) |
void | removeLast (void) |
int | count (void) const |
bool | contains (const T &item) const |
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) |
void | addAll (const CC &c) |
void | remove (const T &item) |
void | remove (const Iter &iter) |
void | removeAll (const CC &c) |
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, Comparator< T > > & | operator= (const SortedList< T, Comparator< T > > &sl) |
bool | operator& (const T &e) const |
T & | operator[] (int k) |
const T & | operator[] (int k) const |
Additional Inherited Members | |
![]() | |
typedef List< T, CompareEquiv< Comparator< T > >, DefaultAlloc > | list_t |
![]() | |
void | set (Iter i, const T &val) |
![]() | |
list_t | list |
Set implemented as a sorted list.
The performances for a set of N elements are:
For set operation, M is the size of the second operand set.
T | Type of values in the set. |
M | Manager for allocation and comparison operations. |
typedef T t |
|
inline |
References ListSet< T, C, A >::insert().
Remove the current set the values of the given set.
set | Set of values to return. |
References SortedList< T, C, A >::comparator(), SortedList< T, C, A >::list, List< T, E, A >::remove(), and SortedList< T, Comparator< T >, DefaultAlloc >::set().
Referenced by ListSet< T, C, A >::operator-(), and ListSet< T, C, A >::operator-=().
|
inline |
Insert a value in the set. This adds the value only if it is not already in the set.
v | Added value. |
References SortedList< T, C, A >::add(), and SortedList< T, C, A >::contains().
Referenced by ListSet< T, C, A >::add(), and ListSet< T, C, A >::operator+=().
Join the values of the given set in the current set.
set | Set of values to join in. |
References List< T, E, A >::addBefore(), SortedList< T, C, A >::comparator(), SortedList< T, C, A >::list, and SortedList< T, Comparator< T >, DefaultAlloc >::set().
Referenced by ListSet< T, C, A >::operator+(), ListSet< T, C, A >::operator+=(), ListSet< T, C, A >::operator|(), and ListSet< T, C, A >::operator|=().
Keeps only values that are also in the given.
set | Set of values to keep. |
References SortedList< T, C, A >::comparator(), SortedList< T, C, A >::list, List< T, E, A >::remove(), and SortedList< T, Comparator< T >, DefaultAlloc >::set().
Referenced by ListSet< T, C, A >::operator&(), ListSet< T, C, A >::operator&=(), ListSet< T, C, A >::operator*(), and ListSet< T, C, A >::operator*=().
|
inline |
References ListSet< T, C, A >::insert().
|
inline |
References SortedList< T, C, A >::remove().
|
inline |
|
inline |
References ListSet< T, C, A >::subsetOf().
|
inline |
|
inline |
|
inline |
References SortedList< T, C, A >::begin(), and SortedList< T, C, A >::comparator().
Referenced by ListSet< T, C, A >::operator<(), and ListSet< T, C, A >::operator<=().