|
sparrow 2.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
|
A run-end encoded array. More...
#include <run_end_encoded_array.hpp>
Public Types | |
| using | self_type = run_end_encoded_array |
| using | size_type = std::size_t |
| using | inner_value_type = array_traits::inner_value_type |
| using | value_type = array_traits::value_type |
| using | reference = run_end_encoded_reference |
| using | const_reference = array_traits::const_reference |
| using | iterator = run_encoded_array_iterator<false> |
| using | const_iterator = run_encoded_array_iterator<true> |
| using | reverse_iterator = std::reverse_iterator<iterator> |
| using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
Public Member Functions | |
| SPARROW_API | run_end_encoded_array (arrow_proxy proxy) |
| Constructs run-end encoded array from Arrow proxy. | |
| template<class... Args> requires (mpl::excludes_copy_and_move_ctor_v<run_end_encoded_array, Args...>) | |
| run_end_encoded_array (Args &&... args) | |
| Generic constructor for creating run-end encoded array. | |
| SPARROW_API | run_end_encoded_array (const self_type &) |
| Copy constructor. | |
| SPARROW_API self_type & | operator= (const self_type &) |
| Copy assignment operator. | |
| ~run_end_encoded_array ()=default | |
| run_end_encoded_array (self_type &&)=default | |
| self_type & | operator= (self_type &&)=default |
| SPARROW_API reference | operator[] (std::uint64_t i) |
| Mutable access operator for updating the logical value at index. | |
| SPARROW_API array_traits::const_reference | operator[] (std::uint64_t i) const |
| Constant access operator for getting element at index. | |
| SPARROW_API iterator | begin () |
| Gets an iterator to the beginning of the array. | |
| SPARROW_API iterator | end () |
| Gets an iterator to the end of the array. | |
| SPARROW_API const_iterator | begin () const |
| Gets a constant iterator to the beginning of the array. | |
| SPARROW_API const_iterator | end () const |
| Gets a constant iterator to the end of the array. | |
| SPARROW_API const_iterator | cbegin () const |
| Gets a constant iterator to the beginning of the array. | |
| SPARROW_API const_iterator | cend () const |
| Gets a constant iterator to the end of the array. | |
| SPARROW_API reverse_iterator | rbegin () |
| Gets a reverse iterator to the beginning of the reversed array. | |
| SPARROW_API reverse_iterator | rend () |
| Gets a reverse iterator to the end of the reversed array. | |
| SPARROW_API const_reverse_iterator | rbegin () const |
| Gets a constant reverse iterator to the beginning of reversed the array. | |
| SPARROW_API const_reverse_iterator | rend () const |
| Gets a constant reverse iterator to the end of the reversed array. | |
| SPARROW_API const_reverse_iterator | crbegin () const |
| Gets a constant reverse iterator to the beginning of reversed the array. | |
| SPARROW_API const_reverse_iterator | crend () const |
| Gets a constant reverse iterator to the end of the reversed array. | |
| SPARROW_API reference | front () |
| Gets a mutable reference to the first element. | |
| SPARROW_API array_traits::const_reference | front () const |
| Gets a constant reference to the first element. | |
| SPARROW_API reference | back () |
| Gets a mutable reference to the last element. | |
| SPARROW_API array_traits::const_reference | back () const |
| Gets a reference to the last element. | |
| SPARROW_API iterator | insert (const_iterator pos, const value_type &value) |
| Inserts a single logical value before pos. | |
| SPARROW_API iterator | insert (const_iterator pos, const value_type &value, size_type count) |
| Inserts count copies of value before pos. | |
| template<std::input_iterator InputIt> requires std::constructible_from<value_type, typename std::iterator_traits<InputIt>::value_type> | |
| iterator | insert (const_iterator pos, InputIt first, InputIt last) |
| template<std::ranges::input_range R> requires std::constructible_from<value_type, std::ranges::range_value_t<R>> | |
| iterator | insert (const_iterator pos, R &&range) |
| SPARROW_API iterator | erase (const_iterator pos) |
| Erases the logical value at pos. | |
| SPARROW_API iterator | erase (const_iterator first, const_iterator last) |
| Erases the logical range [first, last). | |
| SPARROW_API void | push_back (const value_type &value) |
| SPARROW_API void | pop_back () |
| SPARROW_API void | resize (size_type new_length, const value_type &value) |
| SPARROW_API void | clear () |
| SPARROW_API bool | empty () const |
| Checks if the array is empty. | |
| SPARROW_API size_type | size () const |
| Gets the number of elements in the array. | |
| std::optional< std::string_view > | name () const |
| Gets the name of the array. | |
| std::optional< key_value_view > | metadata () const |
| Gets the metadata of the array. | |
Friends | |
| class | run_encoded_array_iterator< false > |
| class | run_encoded_array_iterator< true > |
| class | run_end_encoded_reference |
| class | detail::array_access |
A run-end encoded array.
To use for data with long runs of identical values
This array is used to store data in a run-length encoded format, where each run is represented by a length and a value. Compresses data by storing run lengths for consecutive identical values.
Performance notes:
Related Apache Arrow description and specification:
Definition at line 100 of file run_end_encoded_array.hpp.
Definition at line 111 of file run_end_encoded_array.hpp.
Definition at line 109 of file run_end_encoded_array.hpp.
| using sparrow::run_end_encoded_array::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 113 of file run_end_encoded_array.hpp.
Definition at line 106 of file run_end_encoded_array.hpp.
Definition at line 110 of file run_end_encoded_array.hpp.
Definition at line 108 of file run_end_encoded_array.hpp.
| using sparrow::run_end_encoded_array::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 112 of file run_end_encoded_array.hpp.
Definition at line 104 of file run_end_encoded_array.hpp.
| using sparrow::run_end_encoded_array::size_type = std::size_t |
Definition at line 105 of file run_end_encoded_array.hpp.
Definition at line 107 of file run_end_encoded_array.hpp.
|
explicit |
Constructs run-end encoded array from Arrow proxy.
| proxy | Arrow proxy containing run-end encoded array data and schema |
|
inlineexplicit |
Generic constructor for creating run-end encoded array.
Creates a run-end encoded array from various input types. Arguments are forwarded to compatible create_proxy() functions.
| Args | Parameter pack for constructor arguments |
| args | Constructor arguments (data ranges, validity, metadata, etc.) |
Definition at line 141 of file run_end_encoded_array.hpp.
| SPARROW_API sparrow::run_end_encoded_array::run_end_encoded_array | ( | const self_type & | ) |
Copy constructor.
| rhs | Source array to copy from |
|
default |
|
default |
|
nodiscard |
Gets a mutable reference to the last element.
|
nodiscard |
Gets a reference to the last element.
|
nodiscard |
Gets an iterator to the beginning of the array.
|
nodiscard |
Gets a constant iterator to the beginning of the array.
|
nodiscard |
Gets a constant iterator to the beginning of the array.
|
nodiscard |
Gets a constant iterator to the end of the array.
| SPARROW_API void sparrow::run_end_encoded_array::clear | ( | ) |
|
nodiscard |
Gets a constant reverse iterator to the beginning of reversed the array.
|
nodiscard |
Gets a constant reverse iterator to the end of the reversed array.
|
nodiscard |
Checks if the array is empty.
|
nodiscard |
Gets an iterator to the end of the array.
|
nodiscard |
Gets a constant iterator to the end of the array.
| SPARROW_API iterator sparrow::run_end_encoded_array::erase | ( | const_iterator | first, |
| const_iterator | last ) |
Erases the logical range [first, last).
This is implemented as a single structural mutation on the encoded runs, rather than repeating single-element erases.
Complexity: $O(R_t)$ where $R_t$ is the number of encoded runs touched by, or after, the erased range.
| SPARROW_API iterator sparrow::run_end_encoded_array::erase | ( | const_iterator | pos | ) |
Erases the logical value at pos.
Complexity: $O(R_t)$ where $R_t$ is the number of encoded runs touched by, or after, pos.
|
nodiscard |
Gets a mutable reference to the first element.
|
nodiscard |
Gets a constant reference to the first element.
| SPARROW_API iterator sparrow::run_end_encoded_array::insert | ( | const_iterator | pos, |
| const value_type & | value ) |
Inserts a single logical value before pos.
Complexity: $O(R_t)$ where $R_t$ is the number of encoded runs at or after pos.
| SPARROW_API iterator sparrow::run_end_encoded_array::insert | ( | const_iterator | pos, |
| const value_type & | value, | ||
| size_type | count ) |
Inserts count copies of value before pos.
This is implemented as a single structural mutation on the encoded runs, rather than repeating single-element inserts.
Complexity: $O(R_t)$ where $R_t$ is the number of encoded runs at or after pos.
|
inline |
|
inline |
|
nodiscard |
Gets the metadata of the array.
|
nodiscard |
Gets the name of the array.
| SPARROW_API self_type & sparrow::run_end_encoded_array::operator= | ( | const self_type & | ) |
Copy assignment operator.
| rhs | Source array to copy from |
|
nodiscard |
Mutable access operator for updating the logical value at index.
| i | The index of the element to access. |
|
nodiscard |
Constant access operator for getting element at index.
| i | The index of the element to access. |
| SPARROW_API void sparrow::run_end_encoded_array::pop_back | ( | ) |
| SPARROW_API void sparrow::run_end_encoded_array::push_back | ( | const value_type & | value | ) |
|
nodiscard |
Gets a reverse iterator to the beginning of the reversed array.
|
nodiscard |
Gets a constant reverse iterator to the beginning of reversed the array.
|
nodiscard |
Gets a reverse iterator to the end of the reversed array.
|
nodiscard |
Gets a constant reverse iterator to the end of the reversed array.
| SPARROW_API void sparrow::run_end_encoded_array::resize | ( | size_type | new_length, |
| const value_type & | value ) |
|
nodiscard |
Gets the number of elements in the array.
|
friend |
Definition at line 533 of file run_end_encoded_array.hpp.
|
friend |
Definition at line 527 of file run_end_encoded_array.hpp.
|
friend |
Definition at line 527 of file run_end_encoded_array.hpp.
|
friend |
Definition at line 532 of file run_end_encoded_array.hpp.