-
Notifications
You must be signed in to change notification settings - Fork 1
/
HashFactory.h
37 lines (32 loc) · 1.04 KB
/
HashFactory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef HASHFACTORY_H
#define HASHFACTORY_H
#include <vector>
#include <iostream>
#include <string>
using namespace std;
//*******************************************************//
// Using this class to print what we have about how //
// to compute the hash value of the string. //
// //
//*******************************************************//
class HashFactory
{
vector<string> info;
int numHash; //the label of hash method
public:
HashFactory()
{
addInfo("multiply");
addInfo("FNV");
addInfo("SDBM");
}
void printInfo();
void addInfo(string _info);
unsigned long ChoseHash(char *tok[], int Ntoken);
unsigned long hash1(char *tok[], int Ntoken);
unsigned long hash2(char *tok[], int Ntoken);
unsigned long hash3(char *tok[], int Ntoken);
void set_numHash(int num) {numHash = num;}
int get_numHash() {return numHash;}
};
#endif //HASHFACTORY_H