20#ifndef _HLLSKETCHIMPL_INTERNAL_HPP_
21#define _HLLSKETCHIMPL_INTERNAL_HPP_
23#include "HllSketchImpl.hpp"
24#include "HllSketchImplFactory.hpp"
31HllSketchImpl<A>::HllSketchImpl(uint8_t lgConfigK,
target_hll_type tgtHllType,
33 : lgConfigK_(lgConfigK),
34 tgtHllType_(tgtHllType),
40HllSketchImpl<A>::~HllSketchImpl() {
45 switch ((modeByte >> 2) & 0x3) {
47 return target_hll_type::HLL_4;
49 return target_hll_type::HLL_6;
51 return target_hll_type::HLL_8;
53 throw std::invalid_argument(
"Invalid target HLL type");
58hll_mode HllSketchImpl<A>::extractCurMode(uint8_t modeByte) {
59 switch (modeByte & 0x3) {
61 return hll_mode::LIST;
67 throw std::invalid_argument(
"Invalid current sketch mode");
72uint8_t HllSketchImpl<A>::makeFlagsByte(
bool compact)
const {
74 flags |= (isEmpty() ? hll_constants::EMPTY_FLAG_MASK : 0);
75 flags |= (compact ? hll_constants::COMPACT_FLAG_MASK : 0);
76 flags |= (isOutOfOrderFlag() ? hll_constants::OUT_OF_ORDER_FLAG_MASK : 0);
93uint8_t HllSketchImpl<A>::makeModeByte()
const {
108 switch (tgtHllType_) {
124HllSketchImpl<A>* HllSketchImpl<A>::reset(
bool full_size) {
125 return HllSketchImplFactory<A>::reset(
this, full_size);
134uint8_t HllSketchImpl<A>::getLgConfigK()
const {
139hll_mode HllSketchImpl<A>::getCurMode()
const {
DataSketches namespace.
Definition binomial_bounds.hpp:38
target_hll_type
Specifies the target type of HLL sketch to be created.
Definition hll.hpp:72
@ HLL_6
6 bits per entry (fixed size)
Definition hll.hpp:74
@ HLL_8
8 bits per entry (fastest, fixed size)
Definition hll.hpp:75
@ HLL_4
4 bits per entry (most compact, size may vary)
Definition hll.hpp:73