#include <hash_table.h>
Collaboration diagram for Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >:
based on the sgi implementation: http://www.sgi.com/tech/stl/HashedAssociativeContainer.html
_Key: hash key type _Data: key + value data to store _HashFcn: functional class providing a hash function: int(_Key) Note: in some STL implementations hash is already part of some extension an in namespace std or stdext, in some it is not. So we assume that it is not available. :TODO: _EqualKey: functional class providing a comparison function: bool(_Key, _Key) returns true iff two keys are considered to be equal _ExtractKey: extracts key from _Data: _Key(_Data)
Definition at line 121 of file hash_table.h.
typedef Hash::size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::size_type |
typedef _Key Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::key_type |
Definition at line 128 of file hash_table.h.
typedef _Value Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::value_type |
Definition at line 129 of file hash_table.h.
typedef _HashFcn Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hasher |
Definition at line 130 of file hash_table.h.
typedef _EqualKey Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::key_equal |
Definition at line 131 of file hash_table.h.
typedef BucketNode Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::Bucket [protected] |
Definition at line 147 of file hash_table.h.
typedef std::vector<Bucket*> Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::Data [protected] |
Definition at line 150 of file hash_table.h.
typedef Data::iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::data_iter [protected] |
Definition at line 151 of file hash_table.h.
typedef Data::const_iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::data_const_iter [protected] |
Definition at line 152 of file hash_table.h.
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table | ( | ) | [inline] |
constructors
Definition at line 277 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init().
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table | ( | size_type | initial_capacity | ) | [inline] |
Definition at line 285 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init().
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table | ( | size_type | initial_capacity, | |
const _HashFcn & | hash | |||
) | [inline] |
Definition at line 293 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init().
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table | ( | size_type | initial_capacity, | |
const _HashFcn & | hash, | |||
const _EqualKey & | equal | |||
) | [inline] |
Definition at line 301 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init().
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table | ( | const hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey > & | other | ) | [inline] |
Definition at line 310 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::assignTable(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data.
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::~hash_table | ( | ) | [inline] |
Definition at line 317 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::clear().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash | ( | const key_type & | key | ) | const [inline, protected] |
template parameters
Definition at line 194 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_hash.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketIndex(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize().
bool Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::equal | ( | const key_type & | key1, | |
const key_type & | key2 | |||
) | const [inline, protected] |
Definition at line 199 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_equal.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::find().
const key_type& Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::extractKey | ( | const value_type & | value | ) | const [inline, protected] |
Definition at line 204 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_extractKey.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::find(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketIndex | ( | const key_type & | key | ) | const [inline, protected] |
bucket retrieval
Definition at line 213 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash().
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByKey().
Bucket* Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByKey | ( | const key_type & | key | ) | [inline, protected] |
Definition at line 217 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByIndex(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketIndex().
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::find().
const Bucket* Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByKey | ( | const key_type & | key | ) | const [inline, protected] |
Definition at line 221 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByIndex(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketIndex().
Bucket* Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByIndex | ( | const size_type | index | ) | [inline, protected] |
Definition at line 225 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, and DebugAssert.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByKey().
const Bucket* Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByIndex | ( | const size_type | index | ) | const [inline, protected] |
Definition at line 230 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, and DebugAssert.
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize | ( | ) | [inline, protected] |
resize
Definition at line 240 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::BucketNode::d_next, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::BucketNode::d_value, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::extractKey(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::load_factor(), Hash::next_prime(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::size().
hash_table& Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::operator= | ( | const hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey > & | other | ) | [inline] |
Definition at line 322 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::assignTable(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::clear(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_equal, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_extractKey, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_hash, and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_size.
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::assignTable | ( | const Data & | data | ) | [inline] |
Definition at line 338 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::BucketNode::d_next, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::BucketNode::d_value, and DebugAssert.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::operator=().
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::swap | ( | hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey > & | other | ) | [inline] |
Definition at line 370 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_equal, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_extractKey, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_hash, and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_size.
Referenced by Hash::hash_set< int >::swap(), and Hash::hash_map< long, int >::swap().
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init | ( | ) | [inline] |
Definition at line 379 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table().
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::clear | ( | ) | [inline] |
Definition at line 386 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data, and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_size.
Referenced by Hash::hash_set< int >::clear(), Hash::hash_map< long, int >::clear(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::operator=(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::~hash_table().
iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::find | ( | const key_type & | key | ) | [inline] |
operations
Definition at line 406 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::BucketNode::d_next, Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::equal(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::extractKey(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByKey().
Referenced by Hash::hash_set< int >::find(), and Hash::hash_map< long, int >::find().
const_iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::find | ( | const key_type & | key | ) | const [inline] |
Definition at line 416 of file hash_table.h.
std::pair<iterator, bool> Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::insert | ( | const value_type & | value | ) | [inline] |
Definition at line 428 of file hash_table.h.
Referenced by Hash::hash_set< int >::insert(), and Hash::hash_map< long, int >::insert().
value_type& Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::find_or_insert | ( | const value_type & | value | ) | [inline] |
Definition at line 451 of file hash_table.h.
Referenced by Hash::hash_map< long, int >::operator[]().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::erase | ( | const key_type & | key | ) | [inline] |
Definition at line 475 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::BucketNode::d_next.
Referenced by Hash::hash_set< int >::erase(), and Hash::hash_map< long, int >::erase().
const_iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::erase | ( | const const_iterator & | iter | ) | [inline] |
Definition at line 504 of file hash_table.h.
References Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::BucketNode::d_next.
bool Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::contains | ( | const key_type & | key | ) | const [inline] |
status
Definition at line 539 of file hash_table.h.
Referenced by Hash::hash_set< int >::contains(), and Hash::hash_map< long, int >::contains().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::count | ( | const _Key & | key | ) | const [inline] |
Definition at line 545 of file hash_table.h.
Referenced by Hash::hash_set< int >::count(), and Hash::hash_map< long, int >::count().
bool Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::empty | ( | ) | const [inline] |
Definition at line 555 of file hash_table.h.
Referenced by Hash::hash_set< int >::empty(), and Hash::hash_map< long, int >::empty().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::size | ( | ) | const [inline] |
Definition at line 560 of file hash_table.h.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize(), Hash::hash_set< int >::size(), and Hash::hash_map< long, int >::size().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::bucket_count | ( | ) | const [inline] |
Definition at line 565 of file hash_table.h.
Referenced by Hash::hash_set< int >::bucket_count(), and Hash::hash_map< long, int >::bucket_count().
float Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::load_factor | ( | ) | const [inline] |
Definition at line 570 of file hash_table.h.
Referenced by Hash::hash_set< int >::load_factor(), Hash::hash_map< long, int >::load_factor(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize().
iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::begin | ( | ) | [inline] |
iterators
Definition at line 579 of file hash_table.h.
Referenced by Hash::hash_set< int >::begin(), and Hash::hash_map< long, int >::begin().
const_iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::begin | ( | ) | const [inline] |
Definition at line 595 of file hash_table.h.
iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::end | ( | ) | [inline] |
Definition at line 612 of file hash_table.h.
Referenced by Hash::hash_set< int >::end(), and Hash::hash_map< long, int >::end().
const_iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::end | ( | ) | const [inline] |
Definition at line 617 of file hash_table.h.
friend class iterator [friend] |
Definition at line 157 of file hash_table.h.
friend class const_iterator [friend] |
Definition at line 159 of file hash_table.h.
hasher Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_hash [protected] |
template parameters
Definition at line 170 of file hash_table.h.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::operator=(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::swap().
key_equal Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_equal [protected] |
_ExtractKey Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_extractKey [protected] |
Definition at line 176 of file hash_table.h.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::extractKey(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::operator=(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::swap().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_size [protected] |
Data Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_data [protected] |
Definition at line 183 of file hash_table.h.
Referenced by Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::assignTable(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::clear(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByIndex(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketIndex(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::operator=(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::swap().