sparrow ..
Loading...
Searching...
No Matches
sparrow::primitive_array_impl< T > Class Template Reference

#include <primitive_array_impl.hpp>

Inheritance diagram for sparrow::primitive_array_impl< T >:
[legend]
Collaboration diagram for sparrow::primitive_array_impl< T >:
[legend]

Public Types

using self_type = primitive_array_impl<T>
 
using base_type = mutable_array_bitmap_base<primitive_array_impl<T>>
 
using access_class_type = details::primitive_data_access<T>
 
using size_type = std::size_t
 
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 pointer = typename inner_types::pointer
 
using const_pointer = typename inner_types::const_pointer
 
using value_iterator = typename base_type::value_iterator
 
using const_value_iterator = typename base_type::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

 primitive_array_impl (arrow_proxy)
 Constructs a primitive array from an existing Arrow proxy.
 
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<primitive_array_impl<T>, Args...>)
 primitive_array_impl (Args &&... args)
 Constructs an array of trivial copyable type with values and optional bitmap.
 
template<input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
 primitive_array_impl (std::initializer_list< inner_value_type > init, bool nullable=true, std::optional< std::string_view > name=std::nullopt, std::optional< METADATA_RANGE > metadata=std::nullopt)
 Constructs a primitive array from an initializer list of raw values.
 
constexpr primitive_array_impl (const primitive_array_impl &)
 Copy constructor.
 
constexpr primitive_array_imploperator= (const primitive_array_impl &)
 Copy assignment operator.
 
constexpr primitive_array_impl (primitive_array_impl &&) noexcept
 Move constructor.
 
constexpr primitive_array_imploperator= (primitive_array_impl &&) noexcept
 Move assignment operator.
 
template<std::ranges::input_range VALUE_RANGE, validity_bitmap_input VALIDITY_RANGE, input_metadata_container METADATA_RANGE>
requires (std::convertible_to<std::ranges::range_value_t<VALUE_RANGE>, T>)
arrow_proxy create_proxy (VALUE_RANGE &&values, VALIDITY_RANGE &&validity_input, std::optional< std::string_view > name, std::optional< METADATA_RANGE > metadata)
 
template<validity_bitmap_input VALIDITY_RANGE, input_metadata_container METADATA_RANGE>
arrow_proxy create_proxy (u8_buffer< T > &&data_buffer, size_t size, bool nullable, std::optional< std::string_view > name, std::optional< METADATA_RANGE > metadata)
 
template<std::ranges::input_range R, input_metadata_container METADATA_RANGE>
requires (std::convertible_to<std::ranges::range_value_t<R>, T> && !mpl::is_type_instance_of_v<R, u8_buffer>)
arrow_proxy create_proxy (R &&range, bool nullable, std::optional< std::string_view > name, std::optional< METADATA_RANGE > metadata)
 
- 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
 

Friends

class run_end_encoded_array
 

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<trivial_copyable_type T>
class sparrow::primitive_array_impl< T >

Definition at line 97 of file primitive_array_impl.hpp.

Member Typedef Documentation

◆ access_class_type

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::access_class_type = details::primitive_data_access<T>

◆ base_type

◆ const_pointer

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::const_pointer = typename inner_types::const_pointer

◆ const_value_iterator

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::const_value_iterator = typename base_type::const_value_iterator

◆ inner_const_reference

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::inner_const_reference = typename inner_types::inner_const_reference

◆ inner_reference

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::inner_reference = typename inner_types::inner_reference

◆ inner_types

◆ inner_value_type

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::inner_value_type = typename inner_types::inner_value_type

◆ pointer

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::pointer = typename inner_types::pointer

Definition at line 112 of file primitive_array_impl.hpp.

◆ self_type

◆ size_type

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::size_type = std::size_t

Definition at line 105 of file primitive_array_impl.hpp.

◆ value_iterator

template<trivial_copyable_type T>
using sparrow::primitive_array_impl< T >::value_iterator = typename base_type::value_iterator

Definition at line 115 of file primitive_array_impl.hpp.

Constructor & Destructor Documentation

◆ primitive_array_impl() [1/5]

template<trivial_copyable_type T>
sparrow::primitive_array_impl< T >::primitive_array_impl ( arrow_proxy proxy_param)
explicit

Constructs a primitive array from an existing Arrow proxy.

Parameters
proxy_paramArrow proxy containing the array data and schema
Precondition
proxy_param must contain valid Arrow array and schema data
Arrow schema format must match the primitive type T
Postcondition
Array is initialized with data from the proxy
Array maintains ownership of the proxy data
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/primitive_array_impl.hpp.

Definition at line 456 of file primitive_array_impl.hpp.

Here is the caller graph for this function:

◆ primitive_array_impl() [2/5]

template<trivial_copyable_type T>
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<primitive_array_impl<T>, Args...>)
sparrow::primitive_array_impl< T >::primitive_array_impl ( Args &&... args)
inlineexplicit

Constructs an array of trivial copyable type with values and optional bitmap.

The first argument can be any range of values as long as its value type is convertible to T. The second argument can be:

  • a bitmap range, i.e. a range of boolean-like values indicating the non-missing values. The bitmap range and the value range must have the same size.
  • a range of indices indicating the missing values.
  • omitted: this is equivalent as passing a bitmap range full of true.
Template Parameters
ArgsParameter pack for constructor arguments
Parameters
argsConstructor arguments (values, optional validity bitmap, optional metadata)
Precondition
First argument must be convertible to a range of T values
If bitmap is provided, it must have the same size as the value range
Postcondition
Array contains copies of the provided values
Validity bitmap is set according to the provided bitmap or defaults to all valid

Definition at line 152 of file primitive_array_impl.hpp.

◆ primitive_array_impl() [3/5]

template<trivial_copyable_type T>
template<input_metadata_container METADATA_RANGE = std::vector<metadata_pair>>
sparrow::primitive_array_impl< T >::primitive_array_impl ( std::initializer_list< inner_value_type > init,
bool nullable = true,
std::optional< std::string_view > name = std::nullopt,
std::optional< METADATA_RANGE > metadata = std::nullopt )
inline

Constructs a primitive array from an initializer list of raw values.

Template Parameters
METADATA_RANGEType of metadata container
Parameters
initInitializer list of values
nullableWhether the array should support null values
nameOptional name for the array
metadataOptional metadata for the array
Precondition
All values in init must be valid instances of inner_value_type
Postcondition
Array contains copies of all values from the initializer list
If nullable is true, array supports null values (though none are set)
If nullable is false, array does not support null values

Definition at line 173 of file primitive_array_impl.hpp.

◆ primitive_array_impl() [4/5]

template<trivial_copyable_type T>
sparrow::primitive_array_impl< T >::primitive_array_impl ( const primitive_array_impl< T > & rhs)
constexpr

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
This array is independent of rhs (no shared ownership)

Definition at line 463 of file primitive_array_impl.hpp.

Here is the call graph for this function:

◆ primitive_array_impl() [5/5]

template<trivial_copyable_type T>
sparrow::primitive_array_impl< T >::primitive_array_impl ( primitive_array_impl< T > && rhs)
constexprnoexcept

Move constructor.

Parameters
rhsSource array to move from
Precondition
rhs must be in a valid state
Postcondition
This array takes ownership of rhs data
rhs is left in a valid but unspecified state

Definition at line 478 of file primitive_array_impl.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ create_proxy() [1/3]

template<trivial_copyable_type T>
template<std::ranges::input_range R, input_metadata_container METADATA_RANGE>
requires (std::convertible_to<std::ranges::range_value_t<R>, T> && !mpl::is_type_instance_of_v<R, u8_buffer>)
arrow_proxy sparrow::primitive_array_impl< T >::create_proxy ( R && range,
bool nullable,
std::optional< std::string_view > name,
std::optional< METADATA_RANGE > metadata )

Definition at line 580 of file primitive_array_impl.hpp.

◆ create_proxy() [2/3]

template<trivial_copyable_type T>
template<validity_bitmap_input VALIDITY_RANGE, input_metadata_container METADATA_RANGE>
arrow_proxy sparrow::primitive_array_impl< T >::create_proxy ( u8_buffer< T > && data_buffer,
size_t size,
bool nullable,
std::optional< std::string_view > name,
std::optional< METADATA_RANGE > metadata )

Definition at line 558 of file primitive_array_impl.hpp.

◆ create_proxy() [3/3]

template<trivial_copyable_type T>
template<std::ranges::input_range VALUE_RANGE, validity_bitmap_input VALIDITY_RANGE, input_metadata_container METADATA_RANGE>
requires (std::convertible_to<std::ranges::range_value_t<VALUE_RANGE>, T>)
arrow_proxy sparrow::primitive_array_impl< T >::create_proxy ( VALUE_RANGE && values,
VALIDITY_RANGE && validity_input,
std::optional< std::string_view > name,
std::optional< METADATA_RANGE > metadata )

Definition at line 514 of file primitive_array_impl.hpp.

◆ operator=() [1/2]

template<trivial_copyable_type T>
primitive_array_impl< T > & sparrow::primitive_array_impl< T >::operator= ( const primitive_array_impl< T > & rhs)
constexpr

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 in this array is properly released
This array is independent of rhs (no shared ownership)
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/primitive_array_impl.hpp.

Definition at line 470 of file primitive_array_impl.hpp.

Here is the call graph for this function:

◆ operator=() [2/2]

template<trivial_copyable_type T>
primitive_array_impl< T > & sparrow::primitive_array_impl< T >::operator= ( primitive_array_impl< T > && rhs)
constexprnoexcept

Move assignment operator.

Parameters
rhsSource array to move from
Returns
Reference to this array
Precondition
rhs must be in a valid state
Postcondition
This array takes ownership of rhs data
Previous data in this array is properly released
rhs is left in a valid but unspecified state

Definition at line 485 of file primitive_array_impl.hpp.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ run_end_encoded_array

template<trivial_copyable_type T>
friend class run_end_encoded_array
friend

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