#ifndef SHBFA_H
#define SHBFA_H 

#include "hash_function.h"
#include "util.h"

class ShBFA
{
public:
	ShBFA();
	~ShBFA();

	ShBFA(uint m, uint k, uint c);
	uint insert(const uchar* str, uint len, uint offset);
	int query(const uchar* str, uint len);
	uint getMemAccNum() {
		return this->queryMemAccNum;
	}

private:
	uchar* bf_base; //Bloom filter base
	uint bf_m; //Bloom filter length
	uint bf_k; //# of hash functions
	uint bf_c; //# of sets
	uint bf_n; //# of elements inserted
	uint(*bf_hfp[18])(const uchar * str, uint len); //Pointers to hash function
	uint queryMemAccNum; //Query memory access times
};

#endif

