HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Friends
tt::recursive_iterator< ParentIt > Class Template Reference

#include <ttauri/recursive_iterator.hpp>

Public Member Functions

 recursive_iterator (recursive_iterator const &other) noexcept=default
 
 recursive_iterator (recursive_iterator &&other) noexcept=default
 
recursive_iteratoroperator= (recursive_iterator const &other) noexcept=default
 
recursive_iteratoroperator= (recursive_iterator &&other) noexcept=default
 
 recursive_iterator (parent_iterator parent_it, parent_iterator parent_it_end, child_iterator child_it) noexcept
 Create an iterator at an element inside a child container.
 
 recursive_iterator (parent_iterator parent_it, parent_iterator parent_it_end) noexcept
 Create a begin iterator at the first child's first element.
 
 recursive_iterator (parent_iterator parent_it_end) noexcept
 Create an end iterator one beyond the last child.
 
parent_iterator parent () const noexcept
 Get the current parent iterator.
 
child_iterator child () const noexcept
 Get the current child iterator.
 
bool at_end () const noexcept
 Check if the iterator is at end.
 
reference operator* () const noexcept
 
pointer operator-> () const noexcept
 
reference operator[] (size_t i) const noexcept
 
recursive_iteratoroperator++ () noexcept
 
recursive_iteratoroperator-- () noexcept
 
recursive_iterator operator++ (int) noexcept
 
recursive_iterator operator-- (int) noexcept
 
recursive_iteratoroperator+= (difference_type rhs) noexcept
 
recursive_iteratoroperator-= (difference_type rhs) noexcept
 

Friends

bool operator== (recursive_iterator const &lhs, recursive_iterator const &rhs) noexcept
 
std::strong_ordering operator<=> (recursive_iterator const &lhs, recursive_iterator const &rhs) noexcept
 
recursive_iterator operator+ (recursive_iterator lhs, difference_type rhs) noexcept
 
recursive_iterator operator- (recursive_iterator lhs, difference_type rhs) noexcept
 
recursive_iterator operator+ (difference_type lhs, recursive_iterator rhs) noexcept
 
difference_type operator- (recursive_iterator const &lhs, recursive_iterator const &rhs) noexcept
 

Detailed Description

template<typename ParentIt>
class tt::recursive_iterator< ParentIt >

An iterator which recursively iterates through nested containers.

Currently only recurses through two levels of containers.

Constructor & Destructor Documentation

◆ recursive_iterator() [1/3]

template<typename ParentIt >
tt::recursive_iterator< ParentIt >::recursive_iterator ( parent_iterator parent_it,
parent_iterator parent_it_end,
child_iterator child_it )
inlinenoexcept

Create an iterator at an element inside a child container.

◆ recursive_iterator() [2/3]

template<typename ParentIt >
tt::recursive_iterator< ParentIt >::recursive_iterator ( parent_iterator parent_it,
parent_iterator parent_it_end )
inlinenoexcept

Create a begin iterator at the first child's first element.

◆ recursive_iterator() [3/3]

template<typename ParentIt >
tt::recursive_iterator< ParentIt >::recursive_iterator ( parent_iterator parent_it_end)
inlinenoexcept

Create an end iterator one beyond the last child.

Member Function Documentation

◆ at_end()

template<typename ParentIt >
bool tt::recursive_iterator< ParentIt >::at_end ( ) const
inlinenoexcept

Check if the iterator is at end.

This iterator must maintain the parent_end value, to make sure not to dereference the parent iterator at end. This function is used to check if the iterator is at end.

Returns
True if the iterator can no longer advance.

◆ child()

template<typename ParentIt >
child_iterator tt::recursive_iterator< ParentIt >::child ( ) const
inlinenoexcept

Get the current child iterator.

It is undefined behaviour to use this function on an iterator that is at_end().

◆ parent()

template<typename ParentIt >
parent_iterator tt::recursive_iterator< ParentIt >::parent ( ) const
inlinenoexcept

Get the current parent iterator.


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