2021-11-14 16:19:11 +01:00
|
|
|
#ifndef PROCESSES_H
|
|
|
|
#define PROCESSES_H
|
|
|
|
|
|
|
|
#include "Rabin_fingerprint.hpp"
|
|
|
|
#include "general_library.hpp"
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <queue>
|
2021-11-14 18:13:51 +01:00
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
2021-11-14 16:19:11 +01:00
|
|
|
|
|
|
|
class Rabin_fingerprint_process {
|
|
|
|
public:
|
|
|
|
Rabin_fingerprint_process(uint32_t irr_poly, size_t window_size_in_bits);
|
|
|
|
void stream_char(char c);
|
|
|
|
void stream_bit(bool b);
|
|
|
|
uint32_t get_fingerprint();
|
2021-11-14 18:13:51 +01:00
|
|
|
std::string get_string_in_window();
|
2021-11-14 16:19:11 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::queue<bool> window;
|
|
|
|
size_t window_size_in_bits;
|
|
|
|
Rabin_fingerprint phi;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|