sparrow 1.0.0
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 = iterator_base<list_value_iterator, list_value, std::random_access_iterator_tag>
 
using size_type = size_t
 

Public Member Functions

 list_value_iterator () noexcept=default
 Default constructor creating an invalid iterator.
 
 list_value_iterator (const list_value *layout, size_type index)
 Constructs iterator for the given list and index.
 

Friends

class iterator_access
 

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 46 of file list_value.hpp.

Member Typedef Documentation

◆ base_type

Definition at line 55 of file list_value.hpp.

◆ self_type

◆ size_type

Definition at line 56 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 list_value * layout,
size_type index )

Constructs iterator for the given list and index.

Parameters
layoutPointer to the parent list_value
indexIndex within the list (relative to list start)
Precondition
layout must be a valid pointer to list_value
index must be <= layout->size() (end iterator allowed)
Postcondition
Iterator is positioned at the specified index
Iterator is valid for dereferencing if index < layout->size()
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ iterator_access

friend class iterator_access
friend

Definition at line 153 of file list_value.hpp.


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