ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::WalkIterator< O, H, P > Class Template Reference

a forward iterator on the nodes H (pointers or indices) of the owner O, from a first node, by the policy P with next( o , n , root ) and the constant none, the end, o being a pointer to the owner; *it is the node More...

#include <ADS/Iterators.h>

Public types

using value_type = H
 the nodes
using reference = H
 a node, by value
using difference_type = std::ptrdiff_t
 the distances
using iterator_concept = std::forward_iterator_tag
 forward for the concepts of C++20
using iterator_category = std::input_iterator_tag
 input for the older algorithms, since *it is a value

Public member functions

 WalkIterator (void)=default
 the end
 WalkIterator (const O *o, H n, H root)
 on the node n of the walk below root of the owner o
reference operator* (void) const
 the node
WalkIterator & operator++ (void)
 to the next node of the walk, P::next( o , n , root )
WalkIterator operator++ (int)
 to the next node, returning the iterator before the step
bool operator== (const WalkIterator &o) const
 equal on the same node

Detailed description

template<class O, class H, class P>
class ADS::WalkIterator< O, H, P >

a forward iterator on the nodes H (pointers or indices) of the owner O, from a first node, by the policy P with next( o , n , root ) and the constant none, the end, o being a pointer to the owner; *it is the node

Member typedef documentation

◆ difference_type

template<class O, class H, class P>
using ADS::WalkIterator< O, H, P >::difference_type = std::ptrdiff_t

the distances

◆ iterator_category

template<class O, class H, class P>
using ADS::WalkIterator< O, H, P >::iterator_category = std::input_iterator_tag

input for the older algorithms, since *it is a value

◆ iterator_concept

template<class O, class H, class P>
using ADS::WalkIterator< O, H, P >::iterator_concept = std::forward_iterator_tag

forward for the concepts of C++20

◆ reference

template<class O, class H, class P>
using ADS::WalkIterator< O, H, P >::reference = H

a node, by value

◆ value_type

template<class O, class H, class P>
using ADS::WalkIterator< O, H, P >::value_type = H

the nodes

Constructor and destructor documentation

◆ WalkIterator() [1/2]

template<class O, class H, class P>
ADS::WalkIterator< O, H, P >::WalkIterator ( void )
default

the end

◆ WalkIterator() [2/2]

template<class O, class H, class P>
ADS::WalkIterator< O, H, P >::WalkIterator ( const O * o,
H n,
H root )
inline

on the node n of the walk below root of the owner o

Member function documentation

◆ operator*()

template<class O, class H, class P>
reference ADS::WalkIterator< O, H, P >::operator* ( void ) const
inline

the node

◆ operator++() [1/2]

template<class O, class H, class P>
WalkIterator ADS::WalkIterator< O, H, P >::operator++ ( int )
inline

to the next node, returning the iterator before the step

◆ operator++() [2/2]

template<class O, class H, class P>
WalkIterator & ADS::WalkIterator< O, H, P >::operator++ ( void )
inline

to the next node of the walk, P::next( o , n , root )

◆ operator==()

template<class O, class H, class P>
bool ADS::WalkIterator< O, H, P >::operator== ( const WalkIterator< O, H, P > & o) const
inline

equal on the same node


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