79 using base_type::operator[];
106 template <
typename InputIt>
107 requires std::input_iterator<InputIt>
115 const auto validity_range = std::ranges::subrange(first, last)
116 | std::views::transform(
119 return obj.has_value();
123 derived.insert_bitmap(
125 validity_range.begin(),
129 const auto value_range = std::ranges::subrange(first, last)
130 | std::views::transform(
136 derived.insert_values(
158 template <std::ranges::input_range R>
162 return insert(pos, std::ranges::begin(range), std::ranges::end(range));
168 template <
typename T>
259 template <
typename T>
263 derived.resize_bitmap(new_length, value.
has_value());
264 derived.resize_values(new_length, value.
get());
277 template <
typename T>
280 return insert(pos, value, 1);
292 template <
typename T>
298 const size_t distance =
static_cast<size_t>(std::distance(this->
cbegin(), pos));
301 derived.insert_value(
sparrow::next(derived.value_cbegin(), distance), value.get(), count);
316 template <
typename T>
334 return erase(pos, pos + 1);
355 const auto count =
static_cast<size_t>(std::distance(first, last));
358 derived.erase_values(
sparrow::next(derived.value_cbegin(), first_index), count);
371 template <
typename T>
array_crtp_base(arrow_proxy)
const_value_range values() const
Returns the raw values of the array (i.e.
arrow_proxy & get_arrow_proxy()
nullable< inner_const_reference, bitmap_const_reference > const_reference
typename inner_types::iterator_tag iterator_tag
std::ranges::subrange< const_bitmap_iterator > const_bitmap_range
const_bitmap_iterator bitmap_cbegin() const
const_iterator begin() const
Returns a constant iterator to the first element of the array.
const_iterator end() const
Returns a constant iterator to the element following the last element of the array.
typename inner_types::inner_const_reference inner_const_reference
size_type size() const
Returns the number of elements in the array.
nullable< inner_value_type > value_type
const_iterator cbegin() const
Returns a constant iterator to the first element of the array.
std::ptrdiff_t difference_type
layout_iterator< iterator_types > const_iterator
bitmap_const_reference has_value(size_type i) const
const_iterator cend() const
Returns a constant iterator to the element following the last element of the array.
typename inner_types::inner_value_type inner_value_type
Proxy class over ArrowArray and ArrowSchema.
SPARROW_API void set_length(size_t length)
Set the length of the ArrowArray.
derived_type & derived_cast()
void pop_back()
Removes the last element of the array.
reference operator[](size_type i)
Returns a reference to the element at the specified position in the array.
iterator insert(const_iterator pos, InputIt first, InputIt last)
Inserts elements from range [first , last ) before pos in the array.
base_type::const_reference const_reference
typename base_type::inner_value_type inner_value_type
mutable_array_base(mutable_array_base &&)=default
bitmap_type::const_reference bitmap_const_reference
bitmap_iterator bitmap_begin()
mutable_array_base & operator=(const mutable_array_base &)=default
iterator insert(const_iterator pos, const nullable< T > &value)
array_inner_types< derived_type > inner_types
bitmap_iterator bitmap_end()
void push_back(const nullable< T > &value)
Appends a copy of value to the end of the array.
typename inner_types::value_iterator value_iterator
typename base_type::value_type value_type
iterator insert(const_iterator pos, std::initializer_list< nullable< T > > values)
mutable_array_base< D > self_type
mutable_array_base & operator=(mutable_array_base &&)=default
iterator insert(const_iterator pos, const nullable< T > &value, size_type count)
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
void resize(size_type new_size, const nullable< T > &value)
Resizes the array to contain new_length elements, does nothing if new_length == size().
typename inner_types::inner_reference inner_reference
iterator begin()
Returns an iterator to the first element of the array.
base_type::iterator_tag iterator_tag
mutable_array_base(arrow_proxy)
std::ranges::subrange< bitmap_iterator > bitmap_range
bitmap_reference has_value(size_type i)
nullable< inner_reference, bitmap_reference > reference
base_type::size_type size_type
bitmap_type::reference bitmap_reference
bitmap_type::iterator bitmap_iterator
base_type::const_bitmap_range const_bitmap_range
iterator erase(const_iterator pos)
Removes the element at pos from the array.
mutable_array_base(const mutable_array_base &)=default
iterator end()
Returns a iterator to the element following the last element of the array.
typename inner_types::bitmap_type bitmap_type
iterator insert(const_iterator pos, const R &range)
Inserts elements from range range before pos in the array.
The nullable class models a value or a reference that can be "null", or missing, like values traditio...
constexpr bool has_value() const noexcept
constexpr reference get() &noexcept
Concept for iterator types.
#define SPARROW_ASSERT_TRUE(expr__)
constexpr bool is_type_instance_of_v
true if T is a concrete type template instanciation of U which is a type template.
constexpr InputIt next(InputIt it, Distance n)
Traits class that must be specialized by array classes inheriting from array_crtp_base.
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