sparrow 1.0.0
|
Memory-efficient array implementation for null data types. More...
#include <null_array.hpp>
Public Types | |
using | inner_value_type = null_type |
using | value_type = nullable<inner_value_type> |
using | iterator = empty_iterator<value_type> |
using | reverse_iterator = std::reverse_iterator<iterator> |
using | const_iterator = empty_iterator<value_type> |
using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
using | reference = iterator::reference |
using | const_reference = const_iterator::reference |
using | size_type = std::size_t |
using | difference_type = iterator::difference_type |
using | iterator_tag = std::random_access_iterator_tag |
using | const_value_iterator = empty_iterator<int> |
using | const_bitmap_iterator = empty_iterator<bool> |
using | const_value_range = std::ranges::subrange<const_value_iterator> |
using | const_bitmap_range = std::ranges::subrange<const_bitmap_iterator> |
Public Member Functions | |
template<input_metadata_container METADATA_RANGE = std::vector<metadata_pair>> | |
null_array (size_t length, std::optional< std::string_view > name=std::nullopt, std::optional< METADATA_RANGE > metadata=std::nullopt) | |
Constructs a null array with specified length and metadata. | |
SPARROW_API | null_array (arrow_proxy) |
Constructs null array from Arrow proxy. | |
SPARROW_API std::optional< std::string_view > | name () const |
Gets the optional name of the array. | |
SPARROW_API std::optional< key_value_view > | metadata () const |
Gets the metadata associated with the array. | |
SPARROW_API size_type | size () const |
Gets the number of elements in the array. | |
SPARROW_API reference | operator[] (size_type i) |
Gets mutable reference to element at specified position. | |
SPARROW_API const_reference | operator[] (size_type i) const |
Gets const reference to element at specified position. | |
SPARROW_API iterator | begin () |
Gets iterator to the beginning of the array. | |
SPARROW_API iterator | end () |
Gets iterator to the end of the array. | |
SPARROW_API const_iterator | begin () const |
Gets const iterator to the beginning of the array. | |
SPARROW_API const_iterator | end () const |
Gets const iterator to the end of the array. | |
SPARROW_API reverse_iterator | rbegin () |
Gets reverse iterator to the beginning of reversed array. | |
SPARROW_API reverse_iterator | rend () |
Gets reverse iterator to the end of reversed array. | |
SPARROW_API const_reverse_iterator | rbegin () const |
Gets const reverse iterator to the beginning of reversed array. | |
SPARROW_API const_reverse_iterator | rend () const |
Gets const reverse iterator to the end of reversed array. | |
SPARROW_API const_iterator | cbegin () const |
Gets const iterator to the beginning of the array. | |
SPARROW_API const_iterator | cend () const |
Gets const iterator to the end of the array. | |
SPARROW_API const_reverse_iterator | crbegin () const |
Gets const reverse iterator to the beginning of reversed array. | |
SPARROW_API const_reverse_iterator | crend () const |
Gets const reverse iterator to the end of reversed array. | |
SPARROW_API reference | front () |
Gets reference to the first element. | |
SPARROW_API const_reference | front () const |
Gets const reference to the first element. | |
SPARROW_API reference | back () |
Gets reference to the last element. | |
SPARROW_API const_reference | back () const |
Gets const reference to the last element. | |
SPARROW_API const_value_range | values () const |
Gets the values as a range (conceptually empty for null arrays). | |
SPARROW_API const_bitmap_range | bitmap () const |
Gets the validity bitmap as a range (all false for null arrays). | |
Friends | |
class | detail::array_access |
Memory-efficient array implementation for null data types.
The null_array provides a specialized implementation for storing arrays where all values are null. This is a significant optimization that avoids allocating any memory buffers while still providing the full array interface.
Key features:
This implementation is particularly useful for:
Related Apache Arrow specification: https://arrow.apache.org/docs/dev/format/Columnar.html#null-layout
Definition at line 216 of file null_array.hpp.
using sparrow::null_array::const_bitmap_iterator = empty_iterator<bool> |
Definition at line 233 of file null_array.hpp.
using sparrow::null_array::const_bitmap_range = std::ranges::subrange<const_bitmap_iterator> |
Definition at line 236 of file null_array.hpp.
Definition at line 224 of file null_array.hpp.
Definition at line 227 of file null_array.hpp.
using sparrow::null_array::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 225 of file null_array.hpp.
using sparrow::null_array::const_value_iterator = empty_iterator<int> |
Definition at line 232 of file null_array.hpp.
using sparrow::null_array::const_value_range = std::ranges::subrange<const_value_iterator> |
Definition at line 235 of file null_array.hpp.
Definition at line 229 of file null_array.hpp.
Definition at line 220 of file null_array.hpp.
Definition at line 222 of file null_array.hpp.
using sparrow::null_array::iterator_tag = std::random_access_iterator_tag |
Definition at line 230 of file null_array.hpp.
Definition at line 226 of file null_array.hpp.
using sparrow::null_array::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 223 of file null_array.hpp.
using sparrow::null_array::size_type = std::size_t |
Definition at line 228 of file null_array.hpp.
Definition at line 221 of file null_array.hpp.
|
inline |
Constructs a null array with specified length and metadata.
METADATA_RANGE | Type of metadata container |
length | Number of null elements in the array |
name | Optional name for the array |
metadata | Optional metadata key-value pairs |
Definition at line 253 of file null_array.hpp.
|
explicit |
Constructs null array from Arrow proxy.
proxy | Arrow proxy containing null array data and schema |
|
nodiscard |
|
nodiscard |
|
nodiscard |
Gets iterator to the beginning of the array.
|
nodiscard |
Gets const iterator to the beginning of the array.
|
nodiscard |
Gets the validity bitmap as a range (all false for null arrays).
|
nodiscard |
Gets const iterator to the beginning of the array.
|
nodiscard |
Gets const iterator to the end of the array.
|
nodiscard |
Gets const reverse iterator to the beginning of reversed array.
|
nodiscard |
Gets const reverse iterator to the end of reversed array.
|
nodiscard |
Gets iterator to the end of the array.
|
nodiscard |
Gets const iterator to the end of the array.
|
nodiscard |
Gets reference to the first element.
|
nodiscard |
Gets const reference to the first element.
|
nodiscard |
Gets the metadata associated with the array.
|
nodiscard |
Gets the optional name of the array.
|
nodiscard |
Gets mutable reference to element at specified position.
i | Index of the element to access |
|
nodiscard |
Gets const reference to element at specified position.
i | Index of the element to access |
|
nodiscard |
Gets reverse iterator to the beginning of reversed array.
|
nodiscard |
Gets const reverse iterator to the beginning of reversed array.
|
nodiscard |
Gets reverse iterator to the end of reversed array.
|
nodiscard |
Gets const reverse iterator to the end of reversed array.
|
nodiscard |
Gets the number of elements in the array.
|
nodiscard |
Gets the values as a range (conceptually empty for null arrays).
|
friend |
Definition at line 561 of file null_array.hpp.