sparrow 2.3.1
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
sparrow::list_value_iterator Class Reference

Iterator for traversing elements within a list_value. More...

#include <list_value.hpp>

Inheritance diagram for sparrow::list_value_iterator:
[legend]
Collaboration diagram for sparrow::list_value_iterator:
[legend]

Public Types

using self_type = list_value_iterator
 
using base_type
 
using size_type = size_t
 
- Public Types inherited from sparrow::pointer_index_iterator_base< list_value_iterator, const array, array_traits::const_reference, array_traits::const_reference, std::random_access_iterator_tag >
using size_type
 
using difference_type
 
using size_type
 
using difference_type
 

Public Member Functions

 list_value_iterator () noexcept=default
 Default constructor creating an invalid iterator.
 
 list_value_iterator (const array *flat_array, size_type index)
 Constructs iterator from the raw flat array and absolute position.
 

Friends

class iterator_access
 

Additional Inherited Members

- Protected Member Functions inherited from sparrow::pointer_index_iterator_base< list_value_iterator, const array, array_traits::const_reference, array_traits::const_reference, std::random_access_iterator_tag >
constexpr pointer_index_iterator_base () noexcept=default
 
constexpr pointer_index_iterator_base (const array *p, std::size_t idx) noexcept
 
constexpr void increment () noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr void decrement () noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr void advance (std::ptrdiff_t n) noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr std::ptrdiff_t distance_to (const list_value_iterator &rhs) const noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr bool equal (const list_value_iterator &rhs) const noexcept
 
constexpr bool less_than (const list_value_iterator &rhs) const noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr pointer_index_iterator_base () noexcept=default
 
constexpr pointer_index_iterator_base (const array *p, std::size_t idx) noexcept
 
constexpr void increment () noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr void decrement () noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr void advance (std::ptrdiff_t n) noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr std::ptrdiff_t distance_to (const list_value_iterator &rhs) const noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
constexpr bool equal (const list_value_iterator &rhs) const noexcept
 
constexpr bool less_than (const list_value_iterator &rhs) const noexcept(SPARROW_CONTRACTS_THROW_ON_FAILURE==0)
 
- Protected Attributes inherited from sparrow::pointer_index_iterator_base< list_value_iterator, const array, array_traits::const_reference, array_traits::const_reference, std::random_access_iterator_tag >
const arrayp_object
 
std::size_t m_index
 
const arrayp_object
 
std::size_t m_index
 

Detailed Description

Iterator for traversing elements within a list_value.

This iterator provides random access traversal over the elements contained within a list_value object. It implements the full random access iterator interface, allowing efficient element access, arithmetic operations, and comparison operations.

The iterator maintains a pointer to the parent list_value and an index into the flattened array data, providing O(1) access to any element within the list bounds.

Precondition
Parent list_value must remain valid for iterator lifetime
Postcondition
Iterator provides random access to list elements
Dereferencing yields const_reference to array elements
Supports all random access iterator operations

Definition at line 51 of file list_value.hpp.

Member Typedef Documentation

◆ base_type

Initial value:
const array,
std::random_access_iterator_tag>
list_value_iterator() noexcept=default
Default constructor creating an invalid iterator.
mpl::rename< mpl::unique< mpl::transform< detail::array_const_reference_t, all_base_types_t > >, nullable_variant > const_reference

Definition at line 61 of file list_value.hpp.

◆ self_type

◆ size_type

Definition at line 67 of file list_value.hpp.

Constructor & Destructor Documentation

◆ list_value_iterator() [1/2]

sparrow::list_value_iterator::list_value_iterator ( )
defaultnoexcept

Default constructor creating an invalid iterator.

Postcondition
Iterator is in default-constructed state
Iterator must be assigned before use
Here is the caller graph for this function:

◆ list_value_iterator() [2/2]

sparrow::list_value_iterator::list_value_iterator ( const array * flat_array,
size_type index )

Constructs iterator from the raw flat array and absolute position.

Parameters
flat_arrayPointer to the flat child array
indexAbsolute position within the flat array
Precondition
flat_array must be a valid non-null pointer
Postcondition
Iterator is positioned at index in the flat array
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ iterator_access

friend class iterator_access
friend

Definition at line 92 of file list_value.hpp.


The documentation for this class was generated from the following file: