sparrow 0.9.0
Loading...
Searching...
No Matches
sparrow::array_bitmap_base_impl< D, is_mutable > Class Template Reference

#include <array_bitmap_base.hpp>

Inheritance diagram for sparrow::array_bitmap_base_impl< D, is_mutable >:
[legend]
Collaboration diagram for sparrow::array_bitmap_base_impl< D, is_mutable >:
[legend]

Public Types

using base_type = std::conditional_t<is_mutable, mutable_array_base<D>, array_crtp_base<D>>
 
using size_type = std::size_t
 
using bitmap_type = typename base_type::bitmap_type
 
using bitmap_iterator = typename base_type::bitmap_iterator
 
using const_bitmap_iterator = typename base_type::const_bitmap_iterator
 
using bitmap_const_reference = typename base_type::bitmap_const_reference
 
using difference_type = typename base_type::difference_type
 
using const_bitmap_range = typename base_type::const_bitmap_range
 
using iterator_tag = typename base_type::iterator_tag
 

Public Member Functions

template<std::input_iterator InputIt>
requires std::same_as<typename std::iterator_traits<InputIt>::value_type, bool>
constexpr auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable
 

Protected Member Functions

 array_bitmap_base_impl (arrow_proxy proxy)
 Constructs array bitmap base from Arrow proxy.
 
constexpr array_bitmap_base_impl (const array_bitmap_base_impl &)
 Copy constructor.
 
constexpr array_bitmap_base_imploperator= (const array_bitmap_base_impl &)
 Copy assignment operator.
 
constexpr array_bitmap_base_impl (array_bitmap_base_impl &&) noexcept=default
 
constexpr array_bitmap_base_imploperator= (array_bitmap_base_impl &&) noexcept=default
 
constexpr bitmap_typeget_bitmap ()
 Gets mutable reference to the validity bitmap.
 
constexpr const bitmap_typeget_bitmap () const
 Gets const reference to the validity bitmap.
 
constexpr void resize_bitmap (size_type new_length, bool value)
 Resizes the validity bitmap to accommodate new array length.
 
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, bool value, size_type count)
 Inserts validity bits at specified position.
 
template<std::input_iterator InputIt>
requires std::same_as<typename std::iterator_traits<InputIt>::value_type, bool>
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) is_mutable
 Inserts range of validity bits at specified position.
 
constexpr bitmap_iterator erase_bitmap (const_bitmap_iterator pos, size_type count)
 Erases validity bits starting at specified position.
 
constexpr void update ()
 Updates internal bitmap after external modifications to Arrow data.
 
constexpr non_owning_dynamic_bitset< uint8_t > get_non_owning_dynamic_bitset ()
 Gets non-owning view of the bitmap as dynamic bitset.
 
constexpr bitmap_type make_bitmap ()
 Creates bitmap wrapper from current Arrow validity buffer.
 

Detailed Description

template<class D, bool is_mutable>
class sparrow::array_bitmap_base_impl< D, is_mutable >

Definition at line 52 of file array_bitmap_base.hpp.

Member Typedef Documentation

◆ base_type

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::base_type = std::conditional_t<is_mutable, mutable_array_base<D>, array_crtp_base<D>>

◆ bitmap_const_reference

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::bitmap_const_reference = typename base_type::bitmap_const_reference

◆ bitmap_iterator

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::bitmap_iterator = typename base_type::bitmap_iterator

Definition at line 62 of file array_bitmap_base.hpp.

◆ bitmap_type

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::bitmap_type = typename base_type::bitmap_type

Definition at line 61 of file array_bitmap_base.hpp.

◆ const_bitmap_iterator

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::const_bitmap_iterator = typename base_type::const_bitmap_iterator

◆ const_bitmap_range

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::const_bitmap_range = typename base_type::const_bitmap_range

◆ difference_type

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::difference_type = typename base_type::difference_type

Definition at line 66 of file array_bitmap_base.hpp.

◆ iterator_tag

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::iterator_tag = typename base_type::iterator_tag

◆ size_type

template<class D, bool is_mutable>
using sparrow::array_bitmap_base_impl< D, is_mutable >::size_type = std::size_t

Definition at line 59 of file array_bitmap_base.hpp.

Constructor & Destructor Documentation

◆ array_bitmap_base_impl() [1/3]

template<class D, bool is_mutable>
sparrow::array_bitmap_base_impl< D, is_mutable >::array_bitmap_base_impl ( arrow_proxy proxy)
protected

Constructs array bitmap base from Arrow proxy.

Parameters
proxyArrow proxy containing array data and schema with validity bitmap
Precondition
proxy must contain valid Arrow array and schema
proxy.buffers().size() must be > 0 (validity bitmap at index 0)
proxy validity bitmap must be properly sized for the array length
Postcondition
Array is initialized with data from proxy
Bitmap is constructed from the validity buffer
Base class is properly initialized
Note
Internal assertion: SPARROW_ASSERT_TRUE(arrow_proxy.buffers().size() > bitmap_buffer_index)
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 313 of file array_bitmap_base.hpp.

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

◆ array_bitmap_base_impl() [2/3]

template<class D, bool is_mutable>
sparrow::array_bitmap_base_impl< D, is_mutable >::array_bitmap_base_impl ( const array_bitmap_base_impl< D, is_mutable > & rhs)
constexprprotected

Copy constructor.

Parameters
rhsSource array to copy from
Precondition
rhs must be in a valid state
Postcondition
This array contains a deep copy of rhs data
Bitmap is reconstructed from copied Arrow data
Base class is properly copied

Definition at line 320 of file array_bitmap_base.hpp.

Here is the call graph for this function:

◆ array_bitmap_base_impl() [3/3]

template<class D, bool is_mutable>
sparrow::array_bitmap_base_impl< D, is_mutable >::array_bitmap_base_impl ( array_bitmap_base_impl< D, is_mutable > && )
constexprprotecteddefaultnoexcept

Member Function Documentation

◆ erase_bitmap()

template<class D, bool is_mutable>
requires is_mutable
auto sparrow::array_bitmap_base_impl< D, is_mutable >::erase_bitmap ( const_bitmap_iterator pos,
size_type count )
constexprprotected

Erases validity bits starting at specified position.

Parameters
posIterator position where to start erasing validity bits
countNumber of bits to erase
Returns
Iterator pointing to bit after the erased range
Precondition
Array must be constructed with is_mutable = true
pos must be valid iterator within [bitmap_cbegin(), bitmap_cend())
count must be >= 0
pos + count must not exceed bitmap_cend()
Postcondition
count validity bits starting at pos are removed
Bitmap size decreases by count
Array offset is properly handled during erasure
Returns iterator to element after erased range
Note
Internal assertions:
  • SPARROW_ASSERT_TRUE(this->bitmap_cbegin() <= pos)
  • SPARROW_ASSERT_TRUE(pos < this->bitmap_cend())
Only available when is_mutable is true
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 402 of file array_bitmap_base.hpp.

Here is the call graph for this function:

◆ get_bitmap() [1/2]

template<class D, bool is_mutable>
requires is_mutable
auto sparrow::array_bitmap_base_impl< D, is_mutable >::get_bitmap ( )
nodiscardconstexprprotected

Gets mutable reference to the validity bitmap.

Returns
Mutable reference to the bitmap
Precondition
Array must be constructed with is_mutable = true
Postcondition
Returns valid reference to the bitmap for modification
Bitmap modifications affect null status of array elements
Note
Only available when is_mutable is true
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 336 of file array_bitmap_base.hpp.

◆ get_bitmap() [2/2]

template<class D, bool is_mutable>
auto sparrow::array_bitmap_base_impl< D, is_mutable >::get_bitmap ( ) const
nodiscardconstexprprotected

Gets const reference to the validity bitmap.

Returns
Const reference to the bitmap
Postcondition
Returns valid const reference to the bitmap
Bitmap can be read but not modified through this reference

Definition at line 343 of file array_bitmap_base.hpp.

◆ get_non_owning_dynamic_bitset()

template<class D, bool is_mutable>
non_owning_dynamic_bitset< uint8_t > sparrow::array_bitmap_base_impl< D, is_mutable >::get_non_owning_dynamic_bitset ( )
nodiscardconstexprprotected

Gets non-owning view of the bitmap as dynamic bitset.

Returns
Non-owning dynamic bitset wrapper around the validity buffer
Postcondition
Returns valid non-owning view of the bitmap data
View reflects current state of validity buffer
View remains valid while the array exists
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

◆ insert_bitmap() [1/3]

template<class D, bool is_mutable>
requires is_mutable
auto sparrow::array_bitmap_base_impl< D, is_mutable >::insert_bitmap ( const_bitmap_iterator pos,
bool value,
size_type count )
constexprprotected

Inserts validity bits at specified position.

Parameters
posIterator position where to insert validity bits
valueValidity value for inserted bits (true = valid, false = null)
countNumber of bits to insert
Returns
Iterator pointing to first inserted bit
Precondition
Array must be constructed with is_mutable = true
pos must be valid iterator within [bitmap_cbegin(), bitmap_cend()]
count must be >= 0
Postcondition
count validity bits with value are inserted at pos
Bitmap size increases by count
Array offset is properly handled during insertion
Returns iterator to first inserted element
Note
Internal assertions:
  • SPARROW_ASSERT_TRUE(this->bitmap_cbegin() <= pos)
  • SPARROW_ASSERT_TRUE(pos <= this->bitmap_cend())
Only available when is_mutable is true
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 369 of file array_bitmap_base.hpp.

Here is the call graph for this function:

◆ insert_bitmap() [2/3]

template<class D, bool is_mutable>
template<std::input_iterator InputIt>
requires std::same_as<typename std::iterator_traits<InputIt>::value_type, bool>
auto sparrow::array_bitmap_base_impl< D, is_mutable >::insert_bitmap ( const_bitmap_iterator pos,
InputIt first,
InputIt last ) -> bitmap_iterator
constexpr

Definition at line 386 of file array_bitmap_base.hpp.

◆ insert_bitmap() [3/3]

template<class D, bool is_mutable>
template<std::input_iterator InputIt>
requires std::same_as<typename std::iterator_traits<InputIt>::value_type, bool>
bitmap_iterator sparrow::array_bitmap_base_impl< D, is_mutable >::insert_bitmap ( const_bitmap_iterator pos,
InputIt first,
InputIt last )
constexprprotected

Inserts range of validity bits at specified position.

Template Parameters
InputItInput iterator type for boolean values
Parameters
posIterator position where to insert validity bits
firstIterator to beginning of range to insert
lastIterator to end of range to insert
Returns
Iterator pointing to first inserted bit
Precondition
Array must be constructed with is_mutable = true
InputIt must be input iterator with value_type of bool
pos must be valid iterator within [bitmap_cbegin(), bitmap_cend()]
[first, last) must be valid range
Postcondition
All validity bits in [first, last) are inserted at pos
Bitmap size increases by distance(first, last)
Array offset is properly handled during insertion
Returns iterator to first inserted element
Note
Internal assertions:
  • SPARROW_ASSERT_TRUE(this->bitmap_cbegin() <= pos)
  • SPARROW_ASSERT_TRUE(pos <= this->bitmap_cend())
  • SPARROW_ASSERT_TRUE(first <= last)
Only available when is_mutable is true

◆ make_bitmap()

template<class D, bool is_mutable>
auto sparrow::array_bitmap_base_impl< D, is_mutable >::make_bitmap ( )
nodiscardconstexprprotected

Creates bitmap wrapper from current Arrow validity buffer.

Returns
Bitmap object wrapping the current validity buffer
Precondition
Arrow proxy must have validity buffer at index 0
Validity buffer size must be consistent with array length + offset
Postcondition
Returns bitmap wrapper for the validity buffer
Bitmap size is array length + offset for proper indexing
Note
Internal assertion: SPARROW_ASSERT_TRUE(arrow_proxy.buffers().size() > bitmap_buffer_index)
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 349 of file array_bitmap_base.hpp.

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

◆ operator=() [1/2]

template<class D, bool is_mutable>
array_bitmap_base_impl & sparrow::array_bitmap_base_impl< D, is_mutable >::operator= ( array_bitmap_base_impl< D, is_mutable > && )
constexprprotecteddefaultnoexcept

◆ operator=() [2/2]

template<class D, bool is_mutable>
array_bitmap_base_impl< D, is_mutable > & sparrow::array_bitmap_base_impl< D, is_mutable >::operator= ( const array_bitmap_base_impl< D, is_mutable > & rhs)
constexprprotected

Copy assignment operator.

Parameters
rhsSource array to copy from
Returns
Reference to this array
Precondition
rhs must be in a valid state
Postcondition
This array contains a deep copy of rhs data
Previous data is properly released
Bitmap is reconstructed from copied Arrow data
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 328 of file array_bitmap_base.hpp.

Here is the call graph for this function:

◆ resize_bitmap()

template<class D, bool is_mutable>
requires is_mutable
void sparrow::array_bitmap_base_impl< D, is_mutable >::resize_bitmap ( size_type new_length,
bool value )
constexprprotected

Resizes the validity bitmap to accommodate new array length.

Parameters
new_lengthNew length for the array
valueDefault validity value for new elements (true = valid, false = null)
Precondition
Array must be constructed with is_mutable = true
new_length must be a valid array size
Postcondition
Bitmap is resized to accommodate new_length + offset elements
New elements (if any) have validity set to value parameter
Array offset is preserved during resize operation
Note
Only available when is_mutable is true
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 359 of file array_bitmap_base.hpp.

Here is the call graph for this function:

◆ update()

template<class D, bool is_mutable>
requires is_mutable
void sparrow::array_bitmap_base_impl< D, is_mutable >::update ( )
constexprprotected

Updates internal bitmap after external modifications to Arrow data.

This method should be called after any direct modifications to the underlying Arrow buffers to ensure the bitmap wrapper reflects the current state.

Precondition
Array must be constructed with is_mutable = true
Underlying Arrow validity buffer must be in a valid state
Postcondition
Internal bitmap is reconstructed from current Arrow data
Bitmap accurately reflects the current validity buffer state
Note
Only available when is_mutable is true
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/array_bitmap_base.hpp.

Definition at line 415 of file array_bitmap_base.hpp.

Here is the call graph for this function:

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