coal 3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
|
A simple hash table implemented as multiple buckets. HashFnc is any extended hash function: HashFnc(key) = {index1, index2, ..., }. More...
#include <coal/broadphase/detail/simple_hash_table.h>
Public Member Functions | |
SimpleHashTable (const HashFnc &h) | |
void | init (size_t size) |
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 | |
void | clear () |
clear the hash table | |
Protected Types | |
typedef std::list< Data > | Bin |
Protected Attributes | |
std::vector< Bin > | table_ |
HashFnc | h_ |
size_t | table_size_ |
A simple hash table implemented as multiple buckets. HashFnc is any extended hash function: HashFnc(key) = {index1, index2, ..., }.
|
protected |
coal::detail::SimpleHashTable< Key, Data, HashFnc >::SimpleHashTable | ( | const HashFnc & | h | ) |
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::clear | ( | ) |
clear the hash table
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::init | ( | size_t | size | ) |
Init the number of bins in the hash table.
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::insert | ( | Key | key, |
Data | value | ||
) |
std::vector< Data > coal::detail::SimpleHashTable< Key, Data, HashFnc >::query | ( | Key | key | ) | const |
Find the elements in the hash table whose key is the same as query key.
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::remove | ( | Key | key, |
Data | value | ||
) |
remove the key-value pair from the table
|
protected |
|
protected |
|
protected |