sparrow 0.9.0
Loading...
Searching...
No Matches
sparrow::variable_size_binary_array_impl< T, CR, OT > Class Template Reference

A variable-size binary array. More...

#include <variable_size_binary_array.hpp>

Inheritance diagram for sparrow::variable_size_binary_array_impl< T, CR, OT >:
[legend]
Collaboration diagram for sparrow::variable_size_binary_array_impl< T, CR, OT >:
[legend]

Public Types

using self_type = variable_size_binary_array_impl<T, CR, OT>
 
using base_type = mutable_array_bitmap_base<self_type>
 
using inner_types = array_inner_types<self_type>
 
using inner_value_type = typename inner_types::inner_value_type
 
using inner_reference = typename inner_types::inner_reference
 
using inner_const_reference = typename inner_types::inner_const_reference
 
using offset_type = typename inner_types::offset_type
 
using offset_buffer_type = u8_buffer<std::remove_const_t<offset_type>>
 
using char_buffer_type = u8_buffer<char>
 
using byte_buffer_type = u8_buffer<std::byte>
 
using uint8_buffer_type = u8_buffer<std::uint8_t>
 
using bitmap_type = typename base_type::bitmap_type
 
using bitmap_reference = typename base_type::bitmap_reference
 
using bitmap_const_reference = typename base_type::bitmap_const_reference
 
using const_bitmap_range = typename base_type::const_bitmap_range
 
using value_type = nullable<inner_value_type>
 
using reference = nullable<inner_reference, bitmap_reference>
 
using const_reference = nullable<inner_const_reference, bitmap_const_reference>
 
using offset_iterator = typename inner_types::offset_iterator
 
using const_offset_iterator = typename inner_types::const_offset_iterator
 
using size_type = typename base_type::size_type
 
using difference_type = typename base_type::difference_type
 
using iterator_tag = typename base_type::iterator_tag
 
using data_iterator = typename inner_types::data_iterator
 
using const_data_iterator = typename inner_types::const_data_iterator
 
using data_value_type = typename inner_types::data_value_type
 
using value_iterator = typename inner_types::value_iterator
 
using const_value_iterator = typename inner_types::const_value_iterator
 
- Public Types inherited from sparrow::array_bitmap_base_impl< D, true >
using base_type
 
using size_type
 
using bitmap_type
 
using bitmap_iterator
 
using const_bitmap_iterator
 
using bitmap_const_reference
 
using difference_type
 
using const_bitmap_range
 
using iterator_tag
 

Public Member Functions

 variable_size_binary_array_impl (arrow_proxy)
 Constructs array from Arrow proxy.
 
template<class... ARGS>
requires (mpl::excludes_copy_and_move_ctor_v<variable_size_binary_array_impl<T, CR, OT>, ARGS...>)
 variable_size_binary_array_impl (ARGS &&... args)
 Generic constructor for creating array from various inputs.
 
constexpr inner_reference value (size_type i)
 Gets mutable reference to element at specified index.
 
constexpr inner_const_reference value (size_type i) const
 Gets const reference to element at specified index.
 
template<std::ranges::sized_range U>
requires mpl::convertible_ranges<U, T>
constexpr auto insert_value (const_value_iterator pos, U value, size_type count) -> value_iterator
 
template<mpl::iterator_of_type< T > InputIt>
constexpr auto insert_values (const_value_iterator pos, InputIt first, InputIt last) -> value_iterator
 
template<mpl::iterator_of_type< OT > InputIt>
constexpr auto insert_offsets (const_offset_iterator pos, InputIt first_sizes, InputIt last_sizes) -> offset_iterator
 
- Public Member Functions inherited from sparrow::array_bitmap_base_impl< D, true >
constexpr auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable
 
constexpr auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable
 

Static Public Member Functions

template<std::ranges::range SIZES_RANGE>
static constexpr auto offset_from_sizes (SIZES_RANGE &&sizes) -> offset_buffer_type
 Creates offset buffer from a range of sizes.
 

Friends

class variable_size_binary_reference< self_type >
 

Additional Inherited Members

- Protected Member Functions inherited from sparrow::array_bitmap_base_impl< D, true >
 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.
 
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.
 
 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_impl (array_bitmap_base_impl &&) noexcept=default
 
constexpr array_bitmap_base_imploperator= (const array_bitmap_base_impl &)
 Copy assignment operator.
 
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.
 
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<std::ranges::sized_range T, class CR, layout_offset OT>
class sparrow::variable_size_binary_array_impl< T, CR, OT >

A variable-size binary array.

This array is used to store variable-length binary data.

Related Apache Arrow description and specification:

Definition at line 272 of file variable_size_binary_array.hpp.

Member Typedef Documentation

◆ base_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::base_type = mutable_array_bitmap_base<self_type>

Definition at line 285 of file variable_size_binary_array.hpp.

◆ bitmap_const_reference

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::bitmap_const_reference = typename base_type::bitmap_const_reference

Definition at line 300 of file variable_size_binary_array.hpp.

◆ bitmap_reference

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::bitmap_reference = typename base_type::bitmap_reference

Definition at line 299 of file variable_size_binary_array.hpp.

◆ bitmap_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::bitmap_type = typename base_type::bitmap_type

Definition at line 298 of file variable_size_binary_array.hpp.

◆ byte_buffer_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::byte_buffer_type = u8_buffer<std::byte>

Definition at line 295 of file variable_size_binary_array.hpp.

◆ char_buffer_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::char_buffer_type = u8_buffer<char>

Definition at line 294 of file variable_size_binary_array.hpp.

◆ const_bitmap_range

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::const_bitmap_range = typename base_type::const_bitmap_range

Definition at line 301 of file variable_size_binary_array.hpp.

◆ const_data_iterator

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::const_data_iterator = typename inner_types::const_data_iterator

Definition at line 315 of file variable_size_binary_array.hpp.

◆ const_offset_iterator

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::const_offset_iterator = typename inner_types::const_offset_iterator

Definition at line 308 of file variable_size_binary_array.hpp.

◆ const_reference

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::const_reference = nullable<inner_const_reference, bitmap_const_reference>

Definition at line 305 of file variable_size_binary_array.hpp.

◆ const_value_iterator

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::const_value_iterator = typename inner_types::const_value_iterator

Definition at line 319 of file variable_size_binary_array.hpp.

◆ data_iterator

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::data_iterator = typename inner_types::data_iterator

Definition at line 313 of file variable_size_binary_array.hpp.

◆ data_value_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::data_value_type = typename inner_types::data_value_type

Definition at line 316 of file variable_size_binary_array.hpp.

◆ difference_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::difference_type = typename base_type::difference_type

Definition at line 311 of file variable_size_binary_array.hpp.

◆ inner_const_reference

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::inner_const_reference = typename inner_types::inner_const_reference

Definition at line 290 of file variable_size_binary_array.hpp.

◆ inner_reference

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::inner_reference = typename inner_types::inner_reference

Definition at line 289 of file variable_size_binary_array.hpp.

◆ inner_types

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::inner_types = array_inner_types<self_type>

Definition at line 287 of file variable_size_binary_array.hpp.

◆ inner_value_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::inner_value_type = typename inner_types::inner_value_type

Definition at line 288 of file variable_size_binary_array.hpp.

◆ iterator_tag

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::iterator_tag = typename base_type::iterator_tag

Definition at line 312 of file variable_size_binary_array.hpp.

◆ offset_buffer_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::offset_buffer_type = u8_buffer<std::remove_const_t<offset_type>>

Definition at line 293 of file variable_size_binary_array.hpp.

◆ offset_iterator

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::offset_iterator = typename inner_types::offset_iterator

Definition at line 307 of file variable_size_binary_array.hpp.

◆ offset_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::offset_type = typename inner_types::offset_type

Definition at line 292 of file variable_size_binary_array.hpp.

◆ reference

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::reference = nullable<inner_reference, bitmap_reference>

Definition at line 304 of file variable_size_binary_array.hpp.

◆ self_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::self_type = variable_size_binary_array_impl<T, CR, OT>

Definition at line 284 of file variable_size_binary_array.hpp.

◆ size_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::size_type = typename base_type::size_type

Definition at line 310 of file variable_size_binary_array.hpp.

◆ uint8_buffer_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::uint8_buffer_type = u8_buffer<std::uint8_t>

Definition at line 296 of file variable_size_binary_array.hpp.

◆ value_iterator

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::value_iterator = typename inner_types::value_iterator

Definition at line 318 of file variable_size_binary_array.hpp.

◆ value_type

template<std::ranges::sized_range T, class CR, layout_offset OT>
using sparrow::variable_size_binary_array_impl< T, CR, OT >::value_type = nullable<inner_value_type>

Definition at line 303 of file variable_size_binary_array.hpp.

Constructor & Destructor Documentation

◆ variable_size_binary_array_impl() [1/2]

template<std::ranges::sized_range T, class CR, layout_offset OT>
sparrow::variable_size_binary_array_impl< T, CR, OT >::variable_size_binary_array_impl ( arrow_proxy proxy)
explicit

Constructs array from Arrow proxy.

Parameters
proxyArrow proxy containing variable-size binary array data and schema
Precondition
proxy must contain valid Arrow variable-size binary array and schema
proxy format must match the expected format for T and OT
For 32-bit offsets: format must be "u" (string) or "z" (binary)
For 64-bit offsets: format must be "U" (large string) or "Z" (large binary)
Postcondition
Array is initialized with data from proxy
All elements are accessible via array interface
Note
Internal assertions verify data type and offset type compatibility:

Definition at line 856 of file variable_size_binary_array.hpp.

◆ variable_size_binary_array_impl() [2/2]

template<std::ranges::sized_range T, class CR, layout_offset OT>
template<class... ARGS>
requires (mpl::excludes_copy_and_move_ctor_v<variable_size_binary_array_impl<T, CR, OT>, ARGS...>)
sparrow::variable_size_binary_array_impl< T, CR, OT >::variable_size_binary_array_impl ( ARGS &&... args)
inline

Generic constructor for creating array from various inputs.

Creates a variable-size binary array from different input combinations. Arguments are forwarded to compatible create_proxy() functions.

Template Parameters
ARGSParameter pack for constructor arguments
Parameters
argsConstructor arguments (data, offsets, validity, metadata, etc.)
Precondition
Arguments must match one of the create_proxy() overload signatures
ARGS must exclude copy and move constructor signatures
Postcondition
Array is created with the specified data and configuration

Definition at line 354 of file variable_size_binary_array.hpp.

Member Function Documentation

◆ insert_offsets()

template<std::ranges::sized_range T, class CR, layout_offset OT>
template<mpl::iterator_of_type< OT > InputIt>
auto sparrow::variable_size_binary_array_impl< T, CR, OT >::insert_offsets ( const_offset_iterator pos,
InputIt first_sizes,
InputIt last_sizes ) -> offset_iterator
constexpr

Definition at line 1349 of file variable_size_binary_array.hpp.

◆ insert_value()

template<std::ranges::sized_range T, class CR, layout_offset OT>
template<std::ranges::sized_range U>
requires mpl::convertible_ranges<U, T>
auto sparrow::variable_size_binary_array_impl< T, CR, OT >::insert_value ( const_value_iterator pos,
U value,
size_type count ) -> value_iterator
constexpr

Definition at line 1256 of file variable_size_binary_array.hpp.

◆ insert_values()

template<std::ranges::sized_range T, class CR, layout_offset OT>
template<mpl::iterator_of_type< T > InputIt>
auto sparrow::variable_size_binary_array_impl< T, CR, OT >::insert_values ( const_value_iterator pos,
InputIt first,
InputIt last ) -> value_iterator
constexpr

Definition at line 1303 of file variable_size_binary_array.hpp.

◆ offset_from_sizes()

template<std::ranges::sized_range T, class CR, layout_offset OT>
template<std::ranges::range SIZES_RANGE>
auto sparrow::variable_size_binary_array_impl< T, CR, OT >::offset_from_sizes ( SIZES_RANGE && sizes) -> offset_buffer_type
staticnodiscardconstexpr

Creates offset buffer from a range of sizes.

Converts a range of element sizes into cumulative offsets suitable for the variable-size binary format. The resulting buffer starts with 0 and contains cumulative sums of the input sizes.

Template Parameters
SIZES_RANGEType of the sizes range
Parameters
sizesRange of individual element sizes
Returns
Offset buffer with cumulative offsets
Precondition
sizes must be a valid range of size values
Postcondition
Returned buffer has size() + 1 elements
First element is 0, subsequent elements are cumulative sums
Can be used directly for array construction

Definition at line 873 of file variable_size_binary_array.hpp.

Here is the call graph for this function:

◆ value() [1/2]

template<std::ranges::sized_range T, class CR, layout_offset OT>
auto sparrow::variable_size_binary_array_impl< T, CR, OT >::value ( size_type i)
nodiscardconstexpr

Gets mutable reference to element at specified index.

Parameters
iIndex of the element to access
Returns
Mutable reference to the binary element
Precondition
i must be < size()
Postcondition
Returns valid reference providing access to element data
Reference allows modification of the underlying data
Note
Internal assertion: SPARROW_ASSERT_TRUE(i < size())

Definition at line 1187 of file variable_size_binary_array.hpp.

◆ value() [2/2]

template<std::ranges::sized_range T, class CR, layout_offset OT>
auto sparrow::variable_size_binary_array_impl< T, CR, OT >::value ( size_type i) const
nodiscardconstexpr

Gets const reference to element at specified index.

Parameters
iIndex of the element to access
Returns
Const reference to the binary element
Precondition
i must be < size()
Postcondition
Returns valid const reference to element data
Element data spans from offset[i] to offset[i+1]
Note
Internal assertions verify index bounds and offset validity:
  • SPARROW_ASSERT_TRUE(i < this->size())
  • SPARROW_ASSERT_TRUE(offset_begin >= 0)
  • SPARROW_ASSERT_TRUE(offset_end >= 0)

Definition at line 1194 of file variable_size_binary_array.hpp.

Friends And Related Symbol Documentation

◆ variable_size_binary_reference< self_type >

template<std::ranges::sized_range T, class CR, layout_offset OT>
friend class variable_size_binary_reference< self_type >
friend

Definition at line 842 of file variable_size_binary_array.hpp.


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