CVC3
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends

Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey > Class Template Reference

#include <hash_table.h>

Collaboration diagram for Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >:
Collaboration graph
[legend]

List of all members.

Classes

Public Types

Public Member Functions

Protected Types

Protected Member Functions

Protected Attributes

Friends


Detailed Description

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
class Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >

template to instante to hash map and hash set

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.


Member Typedef Documentation

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef Hash::size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::size_type

types

Definition at line 127 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef _Key Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::key_type

Definition at line 128 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef _Value Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::value_type

Definition at line 129 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef _HashFcn Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hasher

Definition at line 130 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef _EqualKey Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::key_equal

Definition at line 131 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef BucketNode Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::Bucket [protected]

Definition at line 147 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef std::vector<Bucket*> Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::Data [protected]

Definition at line 150 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
typedef Data::iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::data_iter [protected]

Definition at line 151 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.


Constructor & Destructor Documentation

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table ( ) [inline]

constructors

Definition at line 277 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash_table ( size_type  initial_capacity) [inline]

Definition at line 285 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::~hash_table ( ) [inline]

Definition at line 317 of file hash_table.h.


Member Function Documentation

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::hash ( const key_type key) const [inline, protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
bool Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::equal ( const key_type key1,
const key_type key2 
) const [inline, protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
const key_type& Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::extractKey ( const value_type value) const [inline, protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketIndex ( const key_type key) const [inline, protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
Bucket* Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByKey ( const key_type key) [inline, protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
Bucket* Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::getBucketByIndex ( const size_type  index) [inline, protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::resize ( ) [inline, protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::assignTable ( const Data data) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::swap ( hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey > &  other) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::init ( ) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
void Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::clear ( ) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::find ( const key_type key) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
std::pair<iterator, bool> Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::insert ( const value_type value) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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[]().

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::erase ( const key_type key) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
bool Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::contains ( const key_type key) const [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::count ( const _Key &  key) const [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
bool Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::empty ( ) const [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::size ( ) const [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
size_type Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::bucket_count ( ) const [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
float Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::load_factor ( ) const [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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().

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
const_iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::begin ( ) const [inline]

Definition at line 595 of file hash_table.h.

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::end ( ) [inline]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
const_iterator Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::end ( ) const [inline]

Definition at line 617 of file hash_table.h.


Friends And Related Function Documentation

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
friend class iterator [friend]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
friend class const_iterator [friend]

Member Data Documentation

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
hasher Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_hash [protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
key_equal Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_equal [protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
_ExtractKey Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::d_extractKey [protected]
template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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().

template<class _Key, class _Value, class _HashFcn, class _EqualKey, class _ExtractKey>
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 >::const_iterator::operator++(), Hash::hash_table< _Key, _Value, _HashFcn, _EqualKey, _ExtractKey >::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().


The documentation for this class was generated from the following file: