MorphologicalAttributeFilters
Public API documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly > Class Template Reference

Allocation-free iterator over one independent grid traversal. More...

#include <RegularGridAdjacency2D.hpp>

Public Types

using iterator_category = std::forward_iterator_tag
 Forward-iterator category for independent multi-pass traversal.
 
using iterator_concept = std::forward_iterator_tag
 C++20 iterator concept for the traversal cursor.
 
using value_type = PixelId
 Linear grid index yielded by the iterator.
 
using difference_type = std::ptrdiff_t
 Signed distance type used by iterator algorithms.
 
using reference = PixelId
 Value-returning reference type.
 
using pointer = void
 No pointer type is exposed because dereference returns a value.
 

Public Member Functions

 IteratorAdjacencyT () noexcept=default
 Constructs an empty adjacency iterator.
 
 IteratorAdjacencyT (const RegularGridAdjacency2D *relation, int row, int column, int index) noexcept
 Creates an iterator over one traversal context.
 
IteratorAdjacencyToperator++ () noexcept
 Advances this iterator without modifying the relation or other ranges.
 
IteratorAdjacencyT operator++ (int) noexcept
 Advances the iterator and returns its previous position.
 
bool operator== (const IteratorAdjacencyT &other) const noexcept
 Returns true when both iterators identify the same traversal position.
 
bool operator!= (const IteratorAdjacencyT &other) const noexcept
 Returns true when the traversal positions differ.
 
PixelId operator* () const noexcept
 Returns the current neighbour as a linear grid index.
 

Detailed Description

template<bool ForwardOnly>
class mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >

Allocation-free iterator over one independent grid traversal.

The iterator yields linear grid indices and respects both grid bounds and the optional forward-only mask. All cursor state belongs to the iterator, not to the adjacency relation.

Definition at line 690 of file RegularGridAdjacency2D.hpp.

Member Typedef Documentation

◆ difference_type

template<bool ForwardOnly>
using mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::difference_type = std::ptrdiff_t

Signed distance type used by iterator algorithms.

Definition at line 750 of file RegularGridAdjacency2D.hpp.

◆ iterator_category

template<bool ForwardOnly>
using mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::iterator_category = std::forward_iterator_tag

Forward-iterator category for independent multi-pass traversal.

Definition at line 743 of file RegularGridAdjacency2D.hpp.

◆ iterator_concept

template<bool ForwardOnly>
using mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::iterator_concept = std::forward_iterator_tag

C++20 iterator concept for the traversal cursor.

Definition at line 745 of file RegularGridAdjacency2D.hpp.

◆ pointer

No pointer type is exposed because dereference returns a value.

Definition at line 754 of file RegularGridAdjacency2D.hpp.

◆ reference

Value-returning reference type.

Definition at line 752 of file RegularGridAdjacency2D.hpp.

◆ value_type

Linear grid index yielded by the iterator.

Definition at line 748 of file RegularGridAdjacency2D.hpp.

Constructor & Destructor Documentation

◆ IteratorAdjacencyT()

template<bool ForwardOnly>
mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::IteratorAdjacencyT ( const RegularGridAdjacency2D relation,
int  row,
int  column,
int  index 
)
inlinenoexcept

Creates an iterator over one traversal context.

Parameters
relationAdjacency relation traversed by the iterator.
rowZero-based row coordinate.
columnZero-based column coordinate.
indexZero-based index.

Definition at line 769 of file RegularGridAdjacency2D.hpp.

Member Function Documentation

◆ operator!=()

template<bool ForwardOnly>
bool mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::operator!= ( const IteratorAdjacencyT< ForwardOnly > &  other) const
inlinenoexcept

Returns true when the traversal positions differ.

Parameters
otherObject to compare with or transfer from.
Returns
True when the traversal positions differ.

Definition at line 812 of file RegularGridAdjacency2D.hpp.

◆ operator*()

template<bool ForwardOnly>
PixelId mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::operator* ( ) const
inlinenoexcept

Returns the current neighbour as a linear grid index.

Returns
The current neighbour as a linear grid index.

Definition at line 819 of file RegularGridAdjacency2D.hpp.

◆ operator++() [1/2]

template<bool ForwardOnly>
IteratorAdjacencyT & mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::operator++ ( )
inlinenoexcept

Advances this iterator without modifying the relation or other ranges.

Returns
Mutable reference to the updated object.

Definition at line 779 of file RegularGridAdjacency2D.hpp.

◆ operator++() [2/2]

template<bool ForwardOnly>
IteratorAdjacencyT mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::operator++ ( int  )
inlinenoexcept

Advances the iterator and returns its previous position.

Returns
Iterator position before the advancement.

Definition at line 790 of file RegularGridAdjacency2D.hpp.

◆ operator==()

template<bool ForwardOnly>
bool mmcfilters::RegularGridAdjacency2D::IteratorAdjacencyT< ForwardOnly >::operator== ( const IteratorAdjacencyT< ForwardOnly > &  other) const
inlinenoexcept

Returns true when both iterators identify the same traversal position.

Parameters
otherObject to compare with or transfer from.
Returns
True when both iterators identify the same traversal position.

Definition at line 802 of file RegularGridAdjacency2D.hpp.


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