#include <HashTable.h>
Public Types | |
| typedef HashTable<K,E,H> | table_type |
| typedef H | hash_type |
| typedef TableEntry<K, E> | value_type |
| typedef std::list< value_type > | container_type |
| typedef container_type::iterator | iterator |
| typedef container_type::const_iterator | const_iterator |
Public Methods | |
| HashTable (int length = 16, int incr = 2) | |
| Standard constructor. More... | |
| virtual | ~HashTable () |
| Stabdard Destructor. More... | |
| iterator | begin () |
| Start of list iterator over table. More... | |
| const_iterator | begin () const |
| Start of list iterator over table (CONST). More... | |
| iterator | end () |
| End of list iterator over table. More... | |
| const_iterator | end () const |
| End of list iterator over table (CONST). More... | |
| void | clear () |
| Clear entire content. More... | |
| long | size () const |
| Access size of the hash table (actual number of entries). More... | |
| void | reserve (int len) |
| Reserve space for hashtable. More... | |
| bool | insert (const K& first, const E& second) |
| Insert element identified by key. More... | |
| value_type* | find (const K& first) |
| Retrieve element by key. More... | |
| const value_type* | find (const K& first) const |
| Retrieve element by key (CONST). More... | |
| void | remove (const K& first) |
| Remove element from table. More... | |
Protected Methods | |
| void | rehash (int new_size) |
| rehash the entire table on growth. More... | |
| value_type* | find (size_t idx, const K& key ) |
| Retrieve element by key. More... | |
| void | remove (value_type* e) |
Protected Attributes | |
| int | m_size |
| Current table size. More... | |
| int | m_incr |
| Increment factor on growth. More... | |
| std::vector<value_type*> | m_vec |
| Vector with pointer to entries. More... | |
| container_type | m_con |
| List with stored table objects. More... | |
| hash_type | m_hash |
| Hash object. More... | |
Description: Hash table which allows to access objects through a hash key. The table automatically rehashes if the table grows. The table is NOT optimized for element removal - this is very slow, because it requires hopping through a list.
Note: Use rather hash tables than STL maps. STL maps do not work with sharable images, because these stupid guys have allocated static storage on the implementation of binary trees......
History :
+---------+----------------------------------------------+--------+
| Date | Comment | Who |
+---------+----------------------------------------------+--------+
| 30/01/00| Initial version. | MF |
+---------+----------------------------------------------+--------+
Author: M.Frank Version: 1.0
Definition at line 43 of file HashTable.h.
|
|||
|
Definition at line 86 of file HashTable.h. |
|
|||
|
Definition at line 84 of file HashTable.h. |
|
|||
|
Definition at line 82 of file HashTable.h. |
|
|||
|
Definition at line 85 of file HashTable.h. |
|
|||
|
Definition at line 81 of file HashTable.h. |
|
|||
|
Definition at line 83 of file HashTable.h. |
|
||||||
|
Standard constructor.
Definition at line 124 of file HashTable.h. |
|
||||
|
Stabdard Destructor.
Definition at line 128 of file HashTable.h. |
|
||||
|
Start of list iterator over table (CONST).
Definition at line 136 of file HashTable.h. |
|
||||
|
Start of list iterator over table.
Definition at line 132 of file HashTable.h. Referenced by RefTableBase::begin(), and RefTableBase::serialize(). |
|
||||
|
Clear entire content.
Definition at line 148 of file HashTable.h. Referenced by RefTableBase::clear(). |
|
||||
|
End of list iterator over table (CONST).
Definition at line 144 of file HashTable.h. |
|
||||
|
End of list iterator over table.
Definition at line 140 of file HashTable.h. Referenced by RefTableBase::end(), RefTableBase::i_reference(), and RefTableBase::serialize(). |
|
||||
|
Retrieve element by key (CONST).
Definition at line 180 of file HashTable.h. |
|
||||
|
Retrieve element by key.
Definition at line 176 of file HashTable.h. |
|
||||||
|
Retrieve element by key.
Definition at line 110 of file HashTable.h. Referenced by find(), and RefTableBase::i_reference(). |
|
||||||
|
Insert element identified by key.
Definition at line 161 of file HashTable.h. Referenced by RefTableBase::insertMapElement(). |
|
||||
|
rehash the entire table on growth.
Definition at line 100 of file HashTable.h. |
|
||||
|
Remove element from table.
Definition at line 185 of file HashTable.h. |
|
||||
|
Definition at line 118 of file HashTable.h. |
|
||||
|
Reserve space for hashtable.
Definition at line 157 of file HashTable.h. Referenced by RefTableBase::reserve(), and RefTableBase::serialize(). |
|
||||
|
Access size of the hash table (actual number of entries).
Definition at line 153 of file HashTable.h. Referenced by RefTableBase::serialize(), and RefTableBase::size(). |
|
|||
|
List with stored table objects.
Definition at line 95 of file HashTable.h. |
|
|||
|
Hash object.
Definition at line 97 of file HashTable.h. |
|
|||
|
Increment factor on growth.
Definition at line 91 of file HashTable.h. |
|
|||
|
Current table size.
Definition at line 89 of file HashTable.h. |
|
|||
|
Vector with pointer to entries.
Definition at line 93 of file HashTable.h. |
1.2.3 written by Dimitri van Heesch,
© 1997-2000