Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/data/HashSet.h>
Classes | |
class | Iter |
Public Types | |
typedef HashSet< T, H, A > | self_t |
Public Member Functions | |
HashSet (int size=211) | |
HashSet (const HashSet< T > &s) | |
const H & | hash () const |
H & | hash () |
const A & | allocator () const |
A & | allocator () |
int | count (void) const |
bool | contains (const T &val) const |
template<class C > | |
bool | containsAll (const C &coll) |
bool | isEmpty (void) const |
operator bool (void) const | |
Iter | begin (void) const |
Iter | end (void) const |
bool | equals (const HashSet< T > &s) const |
bool | operator== (const HashSet< T > &s) const |
bool | operator!= (const HashSet< T > &s) const |
void | clear (void) |
void | add (const T &val) |
template<class C > | |
void | addAll (const C &coll) |
void | remove (const T &val) |
template<class C > | |
void | removeAll (const C &c) |
void | remove (const Iter &i) |
void | copy (const HashSet< T > &s) |
self_t | operator= (const HashSet< T > &s) |
self_t | operator+= (const T &x) |
self_t | operator-= (const T &x) |
void | insert (const T &val) |
bool | subsetOf (const HashSet< T > &s) const |
bool | operator<= (const HashSet< T > &s) const |
bool | operator>= (const HashSet< T > &s) const |
bool | operator< (const HashSet< T > &s) const |
bool | operator> (const HashSet< T > &s) const |
void | join (const HashSet< T > &c) |
void | diff (const HashSet< T > &c) |
void | meet (const HashSet< T > &c) |
self_t & | operator+= (const HashSet< T > &s) |
self_t & | operator|= (const HashSet< T > &s) |
self_t & | operator-= (const HashSet< T > &s) |
self_t & | operator&= (const HashSet< T > &s) |
self_t & | operator*= (const HashSet< T > &s) |
self_t | operator+ (const HashSet< T > &s) const |
self_t | operator| (const HashSet< T > &s) const |
self_t | operator- (const HashSet< T > &s) const |
self_t | operator& (const HashSet< T > &s) const |
self_t | operator* (const HashSet< T > &s) const |
Iter | items (void) const |
Iter | operator* (void) const |
Static Public Attributes | |
static const self_t | null |
Set implemented using an hash table.
T | Type of set elements. |
M | Type of used manager (default to HashManager). |
|
inline |
Build an hash set with the given size. Improved efficiency is obtained with prime number as sizes.
size | Table size (default to 211). |
|
inline |
Add an item to the set.
val | Added item. |
References HashSet< T, H, A >::insert().
Referenced by HashSet< T, H, A >::addAll(), and HashSet< T, H, A >::operator+=().
|
inline |
Add the given collection of items to the set.
coll | Added collection of items. |
References HashSet< T, H, A >::add().
|
inline |
References HashTable< T, H, A >::allocator().
|
inline |
References HashTable< T, H, A >::allocator().
Remove all items of the set.
References HashTable< T, H, A >::clear().
|
inline |
References HashTable< T, H, A >::hasKey().
Referenced by HashSet< T, H, A >::containsAll(), HashSet< T, H, A >::meet(), and HashSet< T, H, A >::subsetOf().
|
inline |
Test if all items of collection c are in the set.
c | Collection to test. |
References HashSet< T, H, A >::contains().
References HashTable< T, H, A >::copy().
Referenced by HashSet< T, H, A >::operator=().
|
inline |
Count the number of items in the set.
References HashTable< T, H, A >::count().
References HashSet< T, H, A >::remove().
Referenced by HashSet< T, H, A >::operator-(), and HashSet< T, H, A >::operator-=().
References HashTable< T, H, A >::equals().
Referenced by HashSet< T, H, A >::operator!=(), and HashSet< T, H, A >::operator==().
|
inline |
References HashTable< T, H, A >::hash().
|
inline |
References HashTable< T, H, A >::hash().
|
inline |
Same add add().
References HashTable< T, H, A >::put().
Referenced by HashSet< T, H, A >::add(), and HashSet< T, H, A >::join().
Test if the set is empty.
References HashTable< T, H, A >::isEmpty().
Referenced by HashSet< T, H, A >::operator bool().
Get an iterator on the items of the set.
Referenced by HashSet< T, H, A >::operator*().
References HashSet< T, H, A >::isEmpty().
References HashSet< T, H, A >::equals().
References HashSet< T, H, A >::meet().
References HashSet< T, H, A >::meet().
References HashSet< T, H, A >::meet().
References HashSet< T, H, A >::items().
References HashSet< T, H, A >::meet().
References HashSet< T, H, A >::join().
References HashSet< T, H, A >::join().
|
inline |
References HashSet< T, H, A >::add().
References HashSet< T, H, A >::diff().
References HashSet< T, H, A >::diff().
|
inline |
References HashSet< T, H, A >::remove().
References HashSet< T, H, A >::subsetOf().
References HashSet< T, H, A >::copy().
References HashSet< T, H, A >::equals().
References HashSet< T, H, A >::subsetOf().
References HashSet< T, H, A >::join().
References HashSet< T, H, A >::join().
Remove the item matching the iterator.
i | Iterator on the item to remove. |
References HashTable< T, H, A >::remove().
|
inline |
Remove the given item from the set.
val | Removed item. |
References HashTable< T, H, A >::remove().
Referenced by HashSet< T, H, A >::diff(), HashSet< T, H, A >::meet(), HashSet< T, H, A >::operator-=(), and HashSet< T, H, A >::removeAll().
|
inline |
Remove a collection of items from the set.
coll | Collection of items to remove. |
References HashSet< T, H, A >::remove().
References HashSet< T, H, A >::contains().
Referenced by HashSet< T, H, A >::operator<=(), and HashSet< T, H, A >::operator>=().
|
static |