80 using base_type::operator[];
107 template <
typename InputIt>
108 requires std::input_iterator<InputIt>
116 const auto validity_range = std::ranges::subrange(first, last)
117 | std::views::transform(
120 return obj.has_value();
124 derived.insert_bitmap(
126 validity_range.begin(),
130 const auto value_range = std::ranges::subrange(first, last)
131 | std::views::transform(
137 derived.insert_values(
159 template <std::ranges::input_range R>
163 return insert(pos, std::ranges::begin(range), std::ranges::end(range));
169 template <
typename T>
265 template <
typename T>
269 derived.resize_bitmap(new_length, value.
has_value());
270 derived.resize_values(new_length, value.
get());
283 template <
typename T>
286 return insert(pos, value, 1);
298 template <
typename T>
304 const size_t distance =
static_cast<size_t>(std::distance(this->
cbegin(), pos));
307 derived.insert_value(
sparrow::next(derived.value_cbegin(), distance), value.get(), count);
322 template <
typename T>
340 return erase(pos, pos + 1);
361 const auto count =
static_cast<size_t>(std::distance(first, last));
364 derived.erase_values(
sparrow::next(derived.value_cbegin(), first_index), count);
377 template <
typename T>
constexpr const_bitmap_iterator bitmap_cbegin() const
Gets const bitmap iterator to the beginning.
constexpr const_value_range values() const
Gets the raw values as a range.
array_crtp_base(arrow_proxy)
Protected constructor from Arrow proxy.
nullable< inner_const_reference, bitmap_const_reference > const_reference
constexpr const_iterator cbegin() const
Gets const iterator to the beginning of the array.
typename inner_types::iterator_tag iterator_tag
std::ranges::subrange< const_bitmap_iterator > const_bitmap_range
typename inner_types::inner_const_reference inner_const_reference
nullable< inner_value_type > value_type
std::ptrdiff_t difference_type
layout_iterator< iterator_types > const_iterator
constexpr arrow_proxy & get_arrow_proxy() noexcept
Gets mutable reference to the Arrow proxy.
constexpr const_iterator cend() const
Gets const iterator to the end of the array.
constexpr const_iterator end() const
Gets iterator to the end of the array.
constexpr const_iterator begin() const
Gets iterator to the beginning of the array.
typename inner_types::inner_value_type inner_value_type
constexpr size_type size() const
Gets the number of elements in the array.
SPARROW_API void set_length(size_t length)
Sets the number of elements in the array.
constexpr derived_type & derived_cast()
constexpr void zero_null_values(const inner_value_type &value=inner_value_type())
Sets all null values in the array to zero.
constexpr bitmap_iterator bitmap_end()
constexpr void push_back(const nullable< T > &value)
Appends a copy of value to the end of the array.
base_type::const_reference const_reference
typename base_type::inner_value_type inner_value_type
bitmap_type::const_reference bitmap_const_reference
constexpr mutable_array_base(mutable_array_base &&) noexcept=default
array_inner_types< derived_type > inner_types
constexpr iterator insert(const_iterator pos, InputIt first, InputIt last)
Inserts elements from range [first , last ) before pos in the array.
typename inner_types::value_iterator value_iterator
typename base_type::value_type value_type
mutable_array_base< D > self_type
constexpr iterator begin()
Returns an iterator to the first element of the array.
constexpr mutable_array_base(const mutable_array_base &) noexcept=default
constexpr void pop_back()
Removes the last element of the array.
base_type::difference_type difference_type
layout_iterator< iterator_types > iterator
base_type::const_iterator const_iterator
array_crtp_base< D > base_type
typename base_type::inner_const_reference inner_const_reference
constexpr iterator insert(const_iterator pos, const R &range)
Inserts elements from range range before pos in the array.
constexpr reference operator[](size_type i)
Returns a reference to the element at the specified position in the array.
typename inner_types::inner_reference inner_reference
constexpr bitmap_reference has_value(size_type i)
constexpr void resize(size_type new_size, const nullable< T > &value)
Resizes the array to contain new_length elements, does nothing if new_length == size().
base_type::iterator_tag iterator_tag
mutable_array_base(arrow_proxy)
std::ranges::subrange< bitmap_iterator > bitmap_range
nullable< inner_reference, bitmap_reference > reference
base_type::size_type size_type
bitmap_type::reference bitmap_reference
constexpr iterator insert(const_iterator pos, const nullable< T > &value)
bitmap_type::iterator bitmap_iterator
base_type::const_bitmap_range const_bitmap_range
constexpr iterator erase(const_iterator pos)
Removes the element at pos from the array.
constexpr iterator end()
Returns a iterator to the element following the last element of the array.
typename inner_types::bitmap_type bitmap_type
constexpr iterator insert(const_iterator pos, std::initializer_list< nullable< T > > values)
constexpr bitmap_iterator bitmap_begin()
constexpr mutable_array_base & operator=(const mutable_array_base &) noexcept=default
constexpr iterator insert(const_iterator pos, const nullable< T > &value, size_type count)
constexpr bool has_value() const noexcept
Checks whether the nullable contains a valid value.
constexpr reference get() &noexcept
Gets mutable reference to the stored value.
Concept for iterator types.
#define SPARROW_ASSERT_TRUE(expr__)
constexpr bool is_type_instance_of_v
Variable template for convenient access to is_type_instance_of.
constexpr void zero_null_values(R &range, const T &default_value=T{})
Sets null values in a range to a default value.
constexpr InputIt next(InputIt it, Distance n)
Traits class that must be specialized by array implementations.
self_type::iterator_tag iterator_tag
self_type::bitmap_iterator bitmap_iterator
self_type::reference reference
self_type::value_type value_type
self_type::value_iterator value_iterator