Public Member Functions |
| | Hashing (int minTableSize=256, const H &hashFunc=H()) |
| | Creates a hash table for given initial table size minTableSize.
|
| | Hashing (const Hashing< K, I > &h) |
| | Copy constructor.
|
| | ~Hashing () |
| HashConstIterator< K, I, H > | begin () const |
| | Returns an hash iterator to the first element in the list of all elements.
|
| void | clear () |
| | Removes all elements from the hash table.
|
| void | del (const K &key) |
| | Removes the element with key key from the hash table (does nothing if no such element).
|
| bool | empty () const |
| | Returns true iff the table is empty, i.e., contains no elements.
|
| HashElement< K, I > * | fastInsert (const K &key, const I &info) |
| | Inserts a new element with key key and information info into the hash table.
|
| HashElement< K, I > * | insert (const K &key, const I &info) |
| | Inserts a new element with key key and information info into the hash table.
|
| HashElement< K, I > * | insertByNeed (const K &key, const I &info) |
| | Inserts a new element with key key and information info into the hash table.
|
| HashElement< K, I > * | lookup (const K &key) const |
| | Returns the hash element with key key in the hash table; returns 0 if no such element.
|
| bool | member (const K &key) const |
| | Returns true iff the hash table contains an element with key key.
|
| Hashing< K, I > & | operator= (const Hashing< K, I > &hashing) |
| | Assignment operator.
|
| int | size () const |
| | Returns the number of elements in the hash table.
|
template<class K, class I, class H = DefHashFunc<K>>
class ogdf::Hashing< K, I, H >
Hashing with chaining and table doubling.
The class Hashing<K,I> implements a hashing table which realizes a mapping from a key type K to an information type I.
The class requires three template parameters:
- K is the type of keys.
- I is the type of information.
- H is the hash function type. The hash function type argument is optional; its default uses the class DefHashFunc.
Definition at line 281 of file Hashing.h.
template<class K, class I, class H = DefHashFunc<K>>
Returns true iff the table is empty, i.e., contains no elements.
Reimplemented from ogdf::HashingBase.
Reimplemented in ogdf::HashArray2D< I1, I2, E, H1, H2 >, ogdf::HashArray2D< int, int, List< edge > >, ogdf::HashArray< I, E, H >, ogdf::HashArray< int, int >, ogdf::HashArray< int, ClusterInfo >, and ogdf::HashArray< int, cluster >.
Definition at line 304 of file Hashing.h.
template<class K, class I, class H = DefHashFunc<K>>
Inserts a new element with key key and information info into the hash table.
This is a faster version of insert() that assumes that no element with key key is already contained in the hash table.
Definition at line 370 of file Hashing.h.
template<class K, class I, class H = DefHashFunc<K>>
Returns the first element in the list of all elements in the hash table.
This function is used by hash iterators for iterating over all elements in the hash table.
- Parameters:
-
| pList | is assigned the list containing the first element. |
- Returns:
- a pointer to the first element or 0 if hash table is empty.
Definition at line 397 of file Hashing.h.
template<class K, class I, class H = DefHashFunc<K>>
Inserts a new element with key key and information info into the hash table.
The new element will only be inserted if no element with key key is already contained; if such an element already exists the information of this element will be changed to info.
Definition at line 336 of file Hashing.h.
template<class K, class I, class H = DefHashFunc<K>>
Inserts a new element with key key and information info into the hash table.
The new element will only be inserted if no element with key key is already contained; if such an element already exists the information of this element remains unchanged.
Definition at line 355 of file Hashing.h.
template<class K, class I, class H = DefHashFunc<K>>
Returns the successor of pElement in the list of all elements in the hash table.
This function is used by hash iterators for iterating over all elements in the hash table.
- Parameters:
-
| pList | is assigned the list containing the first element. |
| pElement | points to an element in the has table. |
- Returns:
- a pointer to the first element or 0 if hash table is empty.
Definition at line 410 of file Hashing.h.
template<class K, class I, class H = DefHashFunc<K>>
Returns the number of elements in the hash table.
Reimplemented from ogdf::HashingBase.
Reimplemented in ogdf::HashArray2D< I1, I2, E, H1, H2 >, ogdf::HashArray2D< int, int, List< edge > >, ogdf::HashArray< I, E, H >, ogdf::HashArray< int, int >, ogdf::HashArray< int, ClusterInfo >, and ogdf::HashArray< int, cluster >.
Definition at line 301 of file Hashing.h.