#ifndef OMABF_H
#define OMABF_H

#include "define.h"
#include "BOBHash.h"
#include <cstring>
#include <iostream>
using namespace std;

#define WORD_LEN 64


//One-memeory-access bloom filter
class OMABF 
{
public:
	OMABF();
	~OMABF();
	OMABF(uint bf_m, uint bf_k);

	uint insert(const unsigned char * str, uint len);
	uint query(const unsigned char * str, uint len);
	uint getMemAccNum() {
		return this->querymemAccNum;
	}
private:
	uint querymemAccNum;

	uint64 *bf_base; //bloom filter base, 64-bit word
	uint bf_m; //bloom filter length
	uint bf_k; //hash function numbers;
	uint bf_n; //# of elements inserted
	BOBHash bf_hfp[MAX_HF];
	BOBHash wordSelectHash; //Select a specific word
};

#endif