34 count_non_null(
const std::uint8_t* data, std::size_t bit_size, std::size_t byte_size)
noexcept;
50 template <
typename SizeType = std::
size_t>
72 template <std::
integral BlockType>
95 template <std::
integral BlockType>
98 const auto* byte_data =
reinterpret_cast<const std::uint8_t*
>(data);
99 const std::size_t byte_size = block_count *
sizeof(BlockType);
100 m_null_count =
static_cast<size_type>(bit_size)
102 count_non_null(byte_data,
static_cast<std::size_t
>(bit_size), byte_size)
108 if (new_value && !old_value)
112 else if (!new_value && old_value)
120 std::swap(m_null_count, other.m_null_count);
130 size_type m_null_count = 0;
147 template <
typename SizeType = std::
size_t>
165 template <std::
integral BlockType>
177 template <std::
integral BlockType>
208 template <
typename P>
209 concept null_count_policy =
requires(P p, P other,
bool b,
typename P::size_type s,
const std::uint8_t* data) {
210 { P::track_null_count } -> std::convertible_to<bool>;
211 { p.update_null_count(b, b) } -> std::same_as<void>;
212 { p.swap_null_count(other) } -> std::same_as<void>;
213 { p.clear_null_count() } -> std::same_as<void>;
214 { p.set_null_count(s) } -> std::same_as<void>;
215 { p.initialize_null_count(data, s, s) } -> std::same_as<void>;
216 { p.recompute_null_count(data, s, s) } -> std::same_as<void>;
constexpr void recompute_null_count(const BlockType *, size_type, size_type) noexcept
constexpr void set_null_count(size_type) noexcept
constexpr void clear_null_count() noexcept
constexpr void initialize_null_count(const BlockType *, size_type, size_type) noexcept
constexpr void update_null_count(bool, bool) noexcept
static constexpr bool track_null_count
constexpr non_tracking_null_count() noexcept=default
constexpr void swap_null_count(non_tracking_null_count &) noexcept
constexpr size_type null_count() const noexcept
constexpr void set_null_count(size_type count) noexcept
constexpr void swap_null_count(tracking_null_count &other) noexcept
constexpr tracking_null_count() noexcept=default
void recompute_null_count(const BlockType *data, size_type bit_size, size_type block_count) noexcept
Recomputes the null count from the buffer.
constexpr void clear_null_count() noexcept
void initialize_null_count(const BlockType *data, size_type bit_size, size_type block_count) noexcept
Initializes the null count by counting bits in the buffer.
constexpr void update_null_count(bool old_value, bool new_value) noexcept
static constexpr bool track_null_count
Concept that checks if a type is a valid null count policy.
SPARROW_API std::size_t count_non_null(const std::uint8_t *data, std::size_t bit_size, std::size_t byte_size) noexcept
Counts the number of bits set to true in a buffer.