Glossygloss  0.2
Glossygloss is set of classes to use several data structure as Tree or hash table.
 All Classes Files Functions Variables Macros Pages
Classes | Macros | Functions
hashtable.hpp File Reference
#include <string>
#include <cassert>
#include <utility>
#include <forward_list>

Go to the source code of this file.

Classes

class  HashtableException
 Exception class to manage Hashtable errors. More...
 
class  Alveole< K, V >
 Class to define Hashtable alveoles. More...
 
class  Hashtable< K, V >
 Maps a key to a value. More...
 

Macros

#define END   nullptr
 macro to define end of alveole chains More...
 
#define ARRAYSIZE   25
 macro to define size of hash arrays More...
 
#define NDEBUG
 

Functions

template<typename K >
unsigned computehash (K element)
 

Detailed Description

File description

data structure to store pairs in a table a hashcode is compute with k to evaluate the suitable place to store the pair

!! WARNING: int hashCode(K key) must be implemented !!

Copyright

This source code is protected by the French intellectual property law.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

File informations

$Date$ 2014/03/27 $Rev$ 0.2 $Author$ Benjamin Sientzoff $URL$ http://www.github.com/blasterbug

Todo:
: removing the last element of a alveoles chain makes trouble (seg fault)

Macro Definition Documentation

#define ARRAYSIZE   25

macro to define size of hash arrays

#define END   nullptr

macro to define end of alveole chains

#define NDEBUG

Function Documentation

template<typename K >
unsigned computehash ( K  element)

Fonction you must define when you're using Hashable An exemple is given in the sample file

Parameters
[in]elementelement to compute hashcode from
[out]hashcodethe hashcode of element, an unsigned integer

template<> unisgned computehash<string>(string element)

your implementation of hashcode function