coal 3.0.2
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Loading...
Searching...
No Matches
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.
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< 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_tsize)

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(Keykey,
Datavalue )

◆ query()

template<typename Key, typename Data, typename HashFnc>
std::vector< Data > coal::detail::SimpleHashTable< Key, Data, HashFnc >::query(Keykey)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(Keykey,
Datavalue )

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: