Public Member Functions | Protected Types | Protected Attributes | List of all members
coal::detail::SimpleHashTable< Key, Data, HashFnc > Class Template Reference

A simple hash table implemented as multiple buckets. HashFnc is any extended hash function: HashFnc(key) = {index1, index2, ..., }. More...

#include <simple_hash_table.h>

Public Member Functions

void clear ()
 clear the hash table More...
 
void init (size_t size)
 Init the number of bins in the hash table. More...
 
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. More...
 
void remove (Key key, Data value)
 remove the key-value pair from the table More...
 
 SimpleHashTable (const HashFnc &h)
 

Protected Types

typedef std::list< Data > Bin
 

Protected Attributes

HashFnc h_
 
std::vector< Bintable_
 
size_t table_size_
 

Detailed Description

template<typename Key, typename Data, typename HashFnc>
class coal::detail::SimpleHashTable< Key, Data, HashFnc >

A simple hash table implemented as multiple buckets. HashFnc is any extended hash function: HashFnc(key) = {index1, index2, ..., }.

Definition at line 52 of file coal/broadphase/detail/simple_hash_table.h.

Member Typedef Documentation

◆ Bin

template<typename Key , typename Data , typename HashFnc >
typedef std::list<Data> coal::detail::SimpleHashTable< Key, Data, HashFnc >::Bin
protected

Definition at line 54 of file coal/broadphase/detail/simple_hash_table.h.

Constructor & Destructor Documentation

◆ SimpleHashTable()

template<typename Key , typename Data , typename HashFnc >
coal::detail::SimpleHashTable< Key, Data, HashFnc >::SimpleHashTable ( const HashFnc &  h)

Member Function Documentation

◆ clear()

template<typename Key , typename Data , typename HashFnc >
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::clear

clear the hash table

Definition at line 103 of file coal/broadphase/detail/simple_hash_table-inl.h.

◆ init()

template<typename Key , typename Data , typename HashFnc >
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::init ( size_t  size)

Init the number of bins in the hash table.

Definition at line 56 of file coal/broadphase/detail/simple_hash_table-inl.h.

◆ insert()

template<typename Key , typename Data , typename HashFnc >
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::insert ( Key  key,
Data  value 
)

◆ query()

template<typename Key , typename Data , typename HashFnc >
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.

Definition at line 77 of file coal/broadphase/detail/simple_hash_table-inl.h.

◆ remove()

template<typename Key , typename Data , typename HashFnc >
void coal::detail::SimpleHashTable< Key, Data, HashFnc >::remove ( Key  key,
Data  value 
)

remove the key-value pair from the table

Definition at line 92 of file coal/broadphase/detail/simple_hash_table-inl.h.

Member Data Documentation

◆ h_

template<typename Key , typename Data , typename HashFnc >
HashFnc coal::detail::SimpleHashTable< Key, Data, HashFnc >::h_
protected

Definition at line 58 of file coal/broadphase/detail/simple_hash_table.h.

◆ table_

template<typename Key , typename Data , typename HashFnc >
std::vector<Bin> coal::detail::SimpleHashTable< Key, Data, HashFnc >::table_
protected

Definition at line 56 of file coal/broadphase/detail/simple_hash_table.h.

◆ table_size_

template<typename Key , typename Data , typename HashFnc >
size_t coal::detail::SimpleHashTable< Key, Data, HashFnc >::table_size_
protected

Definition at line 60 of file coal/broadphase/detail/simple_hash_table.h.


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


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:45:00