#pragma once #include #include #include #include "rust/cxx.h" #include "fi/include/frequent_items_sketch.hpp" struct ThinHeavyHitterRow; class OpaqueHhSketch { public: typedef datasketches::frequent_items_sketch hhsketch; std::unique_ptr> estimate_no_fp() const; std::unique_ptr> estimate_no_fn() const; void update(size_t value, uint64_t weight); std::unique_ptr> state() const; void set_weights(uint64_t total_weight, uint64_t offset); uint64_t get_total_weight() const; uint64_t get_offset() const; private: OpaqueHhSketch(hhsketch&& theta); friend std::unique_ptr new_opaque_hh_sketch(uint8_t lg2_k, size_t hashset_addr); hhsketch inner_; }; std::unique_ptr new_opaque_hh_sketch(uint8_t lg2_k, size_t hashset_addr);