A simple hash table implemented as multiple buckets. HashFnc is any extended hash function: HashFnc(key) = {index1, index2, ..., }. More...
#include <hash.h>
Public Member Functions | |
void | clear () |
clear the hash table | |
void | init (size_t size) |
@ brief Init the number of bins in the hash table | |
void | insert (Key key, Data value) |
std::vector< Data > | query (Key key) const |
Find the elements in the hash table whose key is the same as query key. | |
void | remove (Key key, Data value) |
remove the key-value pair from the table | |
SimpleHashTable (const HashFnc &h) | |
Protected Types | |
typedef std::list< Data > | Bin |
Protected Attributes | |
HashFnc | h_ |
std::vector< Bin > | table_ |
size_t | table_size_ |
A simple hash table implemented as multiple buckets. HashFnc is any extended hash function: HashFnc(key) = {index1, index2, ..., }.
typedef std::list<Data> fcl::SimpleHashTable< Key, Data, HashFnc >::Bin [protected] |
fcl::SimpleHashTable< Key, Data, HashFnc >::SimpleHashTable | ( | const HashFnc & | h | ) | [inline] |
void fcl::SimpleHashTable< Key, Data, HashFnc >::clear | ( | ) | [inline] |
void fcl::SimpleHashTable< Key, Data, HashFnc >::init | ( | size_t | size | ) | [inline] |
void fcl::SimpleHashTable< Key, Data, HashFnc >::insert | ( | Key | key, |
Data | value | ||
) | [inline] |
std::vector<Data> fcl::SimpleHashTable< Key, Data, HashFnc >::query | ( | Key | key | ) | const [inline] |
void fcl::SimpleHashTable< Key, Data, HashFnc >::remove | ( | Key | key, |
Data | value | ||
) | [inline] |
HashFnc fcl::SimpleHashTable< Key, Data, HashFnc >::h_ [protected] |
std::vector<Bin> fcl::SimpleHashTable< Key, Data, HashFnc >::table_ [protected] |
size_t fcl::SimpleHashTable< Key, Data, HashFnc >::table_size_ [protected] |