#ifndef THETA_INTERSECTION_HPP_
#define THETA_INTERSECTION_HPP_
#include "theta_sketch.hpp"
#include "theta_intersection_base.hpp"
namespace datasketches {
template<typename A> class theta_intersection_alloc;
using theta_intersection = theta_intersection_alloc<std::allocator<uint64_t>>;
template<typename Allocator = std::allocator<uint64_t>>
class theta_intersection_alloc {
public:
using Entry = uint64_t;
using ExtractKey = trivial_extract_key;
using Sketch = theta_sketch_alloc<Allocator>;
using CompactSketch = compact_theta_sketch_alloc<Allocator>;
struct nop_policy {
void operator()(uint64_t internal_entry, uint64_t incoming_entry) const {
unused(incoming_entry);
unused(internal_entry);
}
};
using State = theta_intersection_base<Entry, ExtractKey, nop_policy, Sketch, CompactSketch, Allocator>;
explicit theta_intersection_alloc(uint64_t seed = DEFAULT_SEED, const Allocator& allocator = Allocator());
template<typename FwdSketch>
void update(FwdSketch&& sketch);
CompactSketch get_result(bool ordered = true) const;
bool has_result() const;
private:
State state_;
};
}
#include "theta_intersection_impl.hpp"
#endif