#include <hash_table.h>
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] |
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table | ( | size_type | initial_capacity | ) | [inline] |
Definition at line 285 of file hash_table.h.
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.
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.
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.
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::~hash_table | ( | ) | [inline] |
Definition at line 317 of file hash_table.h.
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash | ( | const key_type & | key | ) | const [inline, protected] |
methods
template parameters
Definition at line 194 of file hash_table.h.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::getBucketIndex(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::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.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::erase(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find_or_insert(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert().
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.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::erase(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find_or_insert(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::const_iterator::operator++(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::iterator::operator++(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::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.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::erase(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find_or_insert(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::getBucketByKey(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::const_iterator::operator++(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::iterator::operator++().
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.
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.
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.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::getBucketByKey(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::const_iterator::operator++(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::iterator::operator++().
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.
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize | ( | ) | [inline, protected] |
resize
Definition at line 240 of file hash_table.h.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find_or_insert(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert().
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.
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::assignTable | ( | const Data & | data | ) | [inline] |
Definition at line 338 of file hash_table.h.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::hash_table(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::operator=().
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::swap | ( | hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey > & | other | ) | [inline] |
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init | ( | ) | [inline] |
Definition at line 379 of file hash_table.h.
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::clear | ( | ) | [inline] |
Definition at line 386 of file hash_table.h.
Referenced by Hash::hash_set< Var >::clear(), Hash::hash_map< long, int >::clear(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::operator=(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::~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.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::contains(), Hash::hash_set< Var >::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< Var >::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.
Referenced by Hash::hash_set< Var >::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.
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< Var >::contains(), Hash::hash_map< long, int >::contains(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::count().
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< Var >::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< Var >::empty(), and Hash::hash_map< long, int >::empty().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::size | ( | ) | const [inline] |
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< Var >::bucket_count(), and Hash::hash_map< long, int >::bucket_count().
float Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::load_factor | ( | ) | const [inline] |
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< Var >::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_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::begin(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::contains(), Hash::hash_set< Var >::end(), Hash::hash_map< long, int >::end(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::const_iterator::operator++(), and Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::iterator::operator++().
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.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::begin(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::end(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert().
friend class const_iterator [friend] |
Definition at line 159 of file hash_table.h.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::begin(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::end(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::erase(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find().
hasher Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_hash [protected] |
variables
template parameters
Definition at line 170 of file hash_table.h.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::hash(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::operator=(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::swap().
key_equal Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_equal [protected] |
Definition at line 173 of file hash_table.h.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::equal(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::operator=(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::swap().
_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< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::extractKey(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::operator=(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::swap().
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_size [protected] |
Definition at line 180 of file hash_table.h.
Referenced by Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::begin(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::clear(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::empty(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::erase(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find_or_insert(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::load_factor(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::operator=(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::size(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::swap().
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< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::assignTable(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::begin(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::bucket_count(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::clear(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::erase(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::find_or_insert(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::getBucketByIndex(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::getBucketIndex(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::hash_table(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::init(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::insert(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::load_factor(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::const_iterator::operator++(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table::iterator::operator++(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::operator=(), Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::resize(), and Hash::hash_table< long, std::pair< const long, bool >, hash< long >, std::equal_to< long >, _Select1st< std::pair< const long, bool > > >::swap().