Loading [MathJax]/extensions/tex2jax.js
coal  3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 <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. 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...
 
void clear ()
 clear the hash table More...
 

Protected Types

typedef std::list< Data > Bin
 

Protected Attributes

std::vector< Bintable_
 
HashFnc h_
 
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, ..., }.

Member Typedef Documentation

◆ Bin

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

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

◆ 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.

◆ 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.

◆ 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

Member Data Documentation

◆ h_

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

◆ table_

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

◆ table_size_

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

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