#ifndef CPC_COMMON_HPP_
#define CPC_COMMON_HPP_
#include <memory>
#include "MurmurHash3.h"
namespace datasketches {
namespace cpc_constants {
const uint8_t MIN_LG_K = 4;
const uint8_t MAX_LG_K = 26;
const uint8_t DEFAULT_LG_K = 11;
}
template<typename A> class u32_table;
template<typename A>
struct compressed_state {
using vector_u32 = std::vector<uint32_t, typename std::allocator_traits<A>::template rebind_alloc<uint32_t>>;
explicit compressed_state(const A& allocator): table_data(allocator), table_data_words(0), table_num_entries(0),
window_data(allocator), window_data_words(0) {}
vector_u32 table_data;
uint32_t table_data_words;
uint32_t table_num_entries; vector_u32 window_data;
uint32_t window_data_words;
};
template<typename A>
struct uncompressed_state {
using vector_bytes = std::vector<uint8_t, typename std::allocator_traits<A>::template rebind_alloc<uint8_t>>;
explicit uncompressed_state(const A& allocator): table(allocator), window(allocator) {}
u32_table<A> table;
vector_bytes window;
};
}
#endif