All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Types | Protected Attributes
fcl::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 <hash.h>

List of all members.

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< Bintable_
size_t table_size_

Detailed Description

template<typename Key, typename Data, typename HashFnc>
class fcl::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 51 of file hash.h.


Member Typedef Documentation

template<typename Key , typename Data , typename HashFnc >
typedef std::list<Data> fcl::SimpleHashTable< Key, Data, HashFnc >::Bin [protected]

Definition at line 54 of file hash.h.


Constructor & Destructor Documentation

template<typename Key , typename Data , typename HashFnc >
fcl::SimpleHashTable< Key, Data, HashFnc >::SimpleHashTable ( const HashFnc &  h) [inline]

Definition at line 63 of file hash.h.


Member Function Documentation

template<typename Key , typename Data , typename HashFnc >
void fcl::SimpleHashTable< Key, Data, HashFnc >::clear ( ) [inline]

clear the hash table

Definition at line 116 of file hash.h.

template<typename Key , typename Data , typename HashFnc >
void fcl::SimpleHashTable< Key, Data, HashFnc >::init ( size_t  size) [inline]

@ brief Init the number of bins in the hash table

Definition at line 68 of file hash.h.

template<typename Key , typename Data , typename HashFnc >
void fcl::SimpleHashTable< Key, Data, HashFnc >::insert ( Key  key,
Data  value 
) [inline]

Definition at line 80 of file hash.h.

template<typename Key , typename Data , typename HashFnc >
std::vector<Data> fcl::SimpleHashTable< Key, Data, HashFnc >::query ( Key  key) const [inline]

Find the elements in the hash table whose key is the same as query key.

Definition at line 89 of file hash.h.

template<typename Key , typename Data , typename HashFnc >
void fcl::SimpleHashTable< Key, Data, HashFnc >::remove ( Key  key,
Data  value 
) [inline]

remove the key-value pair from the table

Definition at line 104 of file hash.h.


Member Data Documentation

template<typename Key , typename Data , typename HashFnc >
HashFnc fcl::SimpleHashTable< Key, Data, HashFnc >::h_ [protected]

Definition at line 58 of file hash.h.

template<typename Key , typename Data , typename HashFnc >
std::vector<Bin> fcl::SimpleHashTable< Key, Data, HashFnc >::table_ [protected]

Definition at line 56 of file hash.h.

template<typename Key , typename Data , typename HashFnc >
size_t fcl::SimpleHashTable< Key, Data, HashFnc >::table_size_ [protected]

Definition at line 60 of file hash.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


fcl
Author(s): Jia Pan
autogenerated on Tue Jan 15 2013 16:05:32