sparrow 2.0.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
sparrow::tracking_null_count< SizeType > Class Template Reference

Policy class that enables null count tracking in dynamic_bitset_base. More...

#include <null_count_policy.hpp>

Inheritance diagram for sparrow::tracking_null_count< SizeType >:
[legend]
Collaboration diagram for sparrow::tracking_null_count< SizeType >:
[legend]

Public Types

using size_type = SizeType
 

Public Member Functions

constexpr tracking_null_count () noexcept=default
 
constexpr tracking_null_count (size_type count) noexcept
 
template<std::integral BlockType>
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 size_type null_count () const noexcept
 
constexpr void set_null_count (size_type count) noexcept
 
template<std::integral BlockType>
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 update_null_count (bool old_value, bool new_value) noexcept
 
constexpr void swap_null_count (tracking_null_count &other) noexcept
 
constexpr void clear_null_count () noexcept
 

Static Public Attributes

static constexpr bool track_null_count = true
 

Detailed Description

template<typename SizeType = std::size_t>
class sparrow::tracking_null_count< SizeType >

Policy class that enables null count tracking in dynamic_bitset_base.

When this policy is used, the bitset maintains an internal counter of null (unset) bits, which is updated on every bit modification. This enables O(1) null_count() queries but adds slight overhead to modification operations.

Use this policy when you frequently need to query the number of null bits.

Template Parameters
SizeTypeThe size type used for counting (typically std::size_t)

Definition at line 51 of file null_count_policy.hpp.

Member Typedef Documentation

◆ size_type

template<typename SizeType = std::size_t>
using sparrow::tracking_null_count< SizeType >::size_type = SizeType

Definition at line 56 of file null_count_policy.hpp.

Constructor & Destructor Documentation

◆ tracking_null_count() [1/2]

template<typename SizeType = std::size_t>
sparrow::tracking_null_count< SizeType >::tracking_null_count ( )
constexprdefaultnoexcept
Here is the caller graph for this function:

◆ tracking_null_count() [2/2]

template<typename SizeType = std::size_t>
sparrow::tracking_null_count< SizeType >::tracking_null_count ( size_type count)
inlineexplicitconstexprnoexcept

Definition at line 60 of file null_count_policy.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ clear_null_count()

template<typename SizeType = std::size_t>
void sparrow::tracking_null_count< SizeType >::clear_null_count ( )
inlineconstexprnoexcept

Definition at line 123 of file null_count_policy.hpp.

Here is the caller graph for this function:

◆ initialize_null_count()

template<typename SizeType = std::size_t>
template<std::integral BlockType>
void sparrow::tracking_null_count< SizeType >::initialize_null_count ( const BlockType * data,
size_type bit_size,
size_type block_count )
inlinenoexcept

Initializes the null count by counting bits in the buffer.

Template Parameters
BlockTypeThe integral type used for storage blocks
Parameters
dataPointer to the block data
bit_sizeThe total number of bits
block_countThe number of blocks in the buffer

Definition at line 73 of file null_count_policy.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ null_count()

template<typename SizeType = std::size_t>
size_type sparrow::tracking_null_count< SizeType >::null_count ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 78 of file null_count_policy.hpp.

◆ recompute_null_count()

template<typename SizeType = std::size_t>
template<std::integral BlockType>
void sparrow::tracking_null_count< SizeType >::recompute_null_count ( const BlockType * data,
size_type bit_size,
size_type block_count )
inlinenoexcept

Recomputes the null count from the buffer.

Template Parameters
BlockTypeThe integral type used for storage blocks
Parameters
dataPointer to the block data
bit_sizeThe total number of bits
block_countThe number of blocks in the buffer

Definition at line 96 of file null_count_policy.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_null_count()

template<typename SizeType = std::size_t>
void sparrow::tracking_null_count< SizeType >::set_null_count ( size_type count)
inlineconstexprnoexcept

Definition at line 83 of file null_count_policy.hpp.

Here is the caller graph for this function:

◆ swap_null_count()

template<typename SizeType = std::size_t>
void sparrow::tracking_null_count< SizeType >::swap_null_count ( tracking_null_count< SizeType > & other)
inlineconstexprnoexcept

Definition at line 118 of file null_count_policy.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_null_count()

template<typename SizeType = std::size_t>
void sparrow::tracking_null_count< SizeType >::update_null_count ( bool old_value,
bool new_value )
inlineconstexprnoexcept

Definition at line 106 of file null_count_policy.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ track_null_count

template<typename SizeType = std::size_t>
bool sparrow::tracking_null_count< SizeType >::track_null_count = true
staticconstexpr

Definition at line 55 of file null_count_policy.hpp.


The documentation for this class was generated from the following file: