sparrow 1.2.0
|
#include <struct_array.hpp>
Public Member Functions | |
SPARROW_API | struct_array (arrow_proxy proxy) |
Constructs struct array from Arrow proxy. | |
template<class... Args> requires (mpl::excludes_copy_and_move_ctor_v<struct_array, Args...>) | |
struct_array (Args &&... args) | |
Generic constructor for creating struct array from various inputs. | |
SPARROW_API | struct_array (const struct_array &rhs) |
Copy constructor. | |
SPARROW_API struct_array & | operator= (const struct_array &rhs) |
Copy assignment operator. | |
struct_array (struct_array &&)=default | |
struct_array & | operator= (struct_array &&)=default |
SPARROW_API size_type | children_count () const |
Gets the number of child arrays (fields). | |
SPARROW_API const array_wrapper * | raw_child (std::size_t i) const |
Gets const pointer to child array at specified index. | |
SPARROW_API array_wrapper * | raw_child (std::size_t i) |
Gets mutable pointer to child array at specified index. | |
auto | names () const |
Gets the names of all child arrays. | |
template<layout_or_array A> | |
void | add_child (A &&child) |
Adds a child array to the struct. | |
template<std::ranges::input_range R> requires layout_or_array<std::ranges::range_value_t<R>> | |
void | add_children (R &&children) |
Adds multiple children to the struct array. | |
template<layout_or_array A> | |
void | set_child (A &&child, size_t index) |
Sets a child array at the specified index. | |
SPARROW_API void | pop_children (size_t n) |
Removes the last n children from the struct. | |
![]() | |
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 |
Protected Types | |
using | children_type = std::vector<cloning_ptr<array_wrapper>> |
Protected Member Functions | |
SPARROW_API value_iterator | value_begin () |
Gets iterator to beginning of value range. | |
SPARROW_API value_iterator | value_end () |
Gets iterator to end of value range. | |
SPARROW_API const_value_iterator | value_cbegin () const |
Gets const iterator to beginning of value range. | |
SPARROW_API const_value_iterator | value_cend () const |
Gets const iterator to end of value range. | |
SPARROW_API inner_reference | value (size_type i) |
Gets mutable reference to struct at specified index. | |
SPARROW_API inner_const_reference | value (size_type i) const |
Gets const reference to struct at specified index. | |
SPARROW_API children_type | make_children () |
Creates the children array wrappers. | |
![]() | |
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 & | operator= (const array_bitmap_base_impl &) |
Copy assignment operator. | |
constexpr | array_bitmap_base_impl (array_bitmap_base_impl &&) noexcept=default |
constexpr array_bitmap_base_impl & | operator= (array_bitmap_base_impl &&) noexcept=default |
constexpr bitmap_type & | get_bitmap () |
Gets mutable reference to the validity bitmap. | |
constexpr const bitmap_type & | get_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_impl & | operator= (const array_bitmap_base_impl &) |
Copy assignment operator. | |
constexpr array_bitmap_base_impl & | operator= (array_bitmap_base_impl &&) noexcept=default |
constexpr bitmap_type & | get_bitmap () |
Gets mutable reference to the validity bitmap. | |
constexpr const bitmap_type & | get_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. | |
Static Protected Member Functions | |
template<std::ranges::input_range CHILDREN_RANGE, validity_bitmap_input VB = validity_bitmap, input_metadata_container METADATA_RANGE = std::vector<metadata_pair>> requires std::same_as<std::ranges::range_value_t<CHILDREN_RANGE>, array> | |
static auto | create_proxy (CHILDREN_RANGE &&children, VB &&bitmaps, std::optional< std::string_view > name=std::nullopt, std::optional< METADATA_RANGE > metadata=std::nullopt) -> arrow_proxy |
Creates Arrow proxy from children arrays with explicit validity bitmap. | |
template<std::ranges::input_range CHILDREN_RANGE, input_metadata_container METADATA_RANGE = std::vector<metadata_pair>> requires std::same_as<std::ranges::range_value_t<CHILDREN_RANGE>, array> | |
static auto | create_proxy (CHILDREN_RANGE &&children, bool nullable=true, std::optional< std::string_view > name=std::nullopt, std::optional< METADATA_RANGE > metadata=std::nullopt) -> arrow_proxy |
Creates Arrow proxy from children arrays with nullable flag. | |
template<std::ranges::input_range CHILDREN_RANGE, input_metadata_container METADATA_RANGE = std::vector<metadata_pair>> requires std::same_as<std::ranges::range_value_t<CHILDREN_RANGE>, array> | |
static auto | create_proxy_impl (CHILDREN_RANGE &&children, std::optional< validity_bitmap > &&bitmap, std::optional< std::string_view > name=std::nullopt, std::optional< METADATA_RANGE > metadata=std::nullopt) -> arrow_proxy |
Implementation helper for creating Arrow proxy from components. | |
Protected Attributes | |
children_type | m_children |
Collection of child arrays (fields) | |
Friends | |
class | array_crtp_base< self_type > |
class | detail::layout_value_functor< self_type, inner_value_type > |
class | detail::layout_value_functor< const self_type, inner_value_type > |
Definition at line 124 of file struct_array.hpp.
Definition at line 129 of file struct_array.hpp.
Definition at line 136 of file struct_array.hpp.
using sparrow::struct_array::bitmap_type = typename base_type::bitmap_type |
Definition at line 135 of file struct_array.hpp.
|
protected |
Definition at line 403 of file struct_array.hpp.
Definition at line 138 of file struct_array.hpp.
using sparrow::struct_array::const_reference = nullable<inner_const_reference, bitmap_const_reference> |
Definition at line 145 of file struct_array.hpp.
using sparrow::struct_array::const_value_iterator = typename inner_types::const_value_iterator |
Definition at line 132 of file struct_array.hpp.
Definition at line 142 of file struct_array.hpp.
Definition at line 141 of file struct_array.hpp.
Definition at line 130 of file struct_array.hpp.
Definition at line 140 of file struct_array.hpp.
Definition at line 146 of file struct_array.hpp.
Definition at line 128 of file struct_array.hpp.
using sparrow::struct_array::size_type = typename base_type::size_type |
Definition at line 133 of file struct_array.hpp.
using sparrow::struct_array::value_iterator = typename inner_types::value_iterator |
Definition at line 131 of file struct_array.hpp.
Definition at line 144 of file struct_array.hpp.
|
explicit |
Constructs struct array from Arrow proxy.
proxy | Arrow proxy containing struct array data and schema |
|
inlineexplicit |
Generic constructor for creating struct array from various inputs.
Creates a struct array from different input combinations. Arguments are forwarded to compatible create_proxy() functions based on their types.
Args | Parameter pack for constructor arguments |
args | Constructor arguments (children, validity, metadata, etc.) |
Definition at line 179 of file struct_array.hpp.
SPARROW_API sparrow::struct_array::struct_array | ( | const struct_array & | rhs | ) |
Copy constructor.
rhs | Source struct array to copy from |
|
default |
void sparrow::struct_array::add_child | ( | A && | child | ) |
Adds a child array to the struct.
child | The child array to add |
Definition at line 583 of file struct_array.hpp.
void sparrow::struct_array::add_children | ( | R && | children | ) |
Adds multiple children to the struct array.
This function template adds a range of children (layouts or arrays) to the struct array. All children must have the same size as the current struct array.
R | An input range type whose value type satisfies the layout_or_array concept |
children | A range of child elements to be added to the struct array |
Assertion | error if any child's size doesn't match the struct array's size |
Definition at line 593 of file struct_array.hpp.
|
nodiscard |
Gets the number of child arrays (fields).
|
staticnodiscardprotected |
Creates Arrow proxy from children arrays with nullable flag.
CHILDREN_RANGE | Type of children range |
METADATA_RANGE | Type of metadata container |
children | Range of child arrays (one per field) |
nullable | Whether the struct array should support null values |
name | Optional name for the struct array |
metadata | Optional metadata for the struct array |
Definition at line 506 of file struct_array.hpp.
|
staticnodiscardprotected |
Creates Arrow proxy from children arrays with explicit validity bitmap.
CHILDREN_RANGE | Type of children range |
VB | Type of validity bitmap input |
METADATA_RANGE | Type of metadata container |
children | Range of child arrays (one per field) |
bitmaps | Validity bitmap specification |
name | Optional name for the struct array |
metadata | Optional metadata for the struct array |
Definition at line 487 of file struct_array.hpp.
|
staticnodiscardprotected |
Implementation helper for creating Arrow proxy from components.
CHILDREN_RANGE | Type of children range |
METADATA_RANGE | Type of metadata container |
children | Range of child arrays |
bitmap | Optional validity bitmap |
name | Optional name for the struct array |
metadata | Optional metadata for the struct array |
Definition at line 524 of file struct_array.hpp.
|
nodiscardprotected |
Creates the children array wrappers.
|
inlinenodiscard |
Gets the names of all child arrays.
Definition at line 251 of file struct_array.hpp.
SPARROW_API struct_array & sparrow::struct_array::operator= | ( | const struct_array & | rhs | ) |
Copy assignment operator.
rhs | Source struct array to copy from |
|
default |
SPARROW_API void sparrow::struct_array::pop_children | ( | size_t | n | ) |
Removes the last n children from the struct.
n | The number of children to remove |
|
nodiscard |
Gets mutable pointer to child array at specified index.
i | Index of the child array |
|
nodiscard |
Gets const pointer to child array at specified index.
i | Index of the child array |
void sparrow::struct_array::set_child | ( | A && | child, |
size_t | index ) |
Sets a child array at the specified index.
child | The child array to set |
index | The index at which to set the child |
Definition at line 607 of file struct_array.hpp.
|
nodiscardprotected |
Gets mutable reference to struct at specified index.
i | Index of the struct to access |
|
nodiscardprotected |
Gets const reference to struct at specified index.
i | Index of the struct to access |
|
nodiscardprotected |
Gets iterator to beginning of value range.
|
nodiscardprotected |
Gets const iterator to beginning of value range.
|
nodiscardprotected |
Gets const iterator to end of value range.
|
nodiscardprotected |
Gets iterator to end of value range.
|
friend |
Definition at line 475 of file struct_array.hpp.
|
friend |
Definition at line 475 of file struct_array.hpp.
|
friend |
Definition at line 475 of file struct_array.hpp.
|
protected |
Collection of child arrays (fields)
Definition at line 475 of file struct_array.hpp.