mmcfilters
Public API documentation
Loading...
Searching...
No Matches
mmcfilters::ContourComputation::iterator Class Reference

Single-pass iterator yielding (node, borrowed pixel span). More...

#include <ContourComputation.hpp>

Public Types

using iterator_concept = std::input_iterator_tag
 C++20 iterator concept for this single-pass traversal.
using iterator_category = std::input_iterator_tag
 Iterator category used by standard algorithms.
using value_type = std::pair<NodeId, std::span<const PixelId>>
 Node identifier and borrowed contour span yielded by dereference.
using difference_type = std::ptrdiff_t
 Signed type used to represent iterator distances.

Public Member Functions

value_type operator* () const
 Borrows the current node contour.
iterator & operator++ ()
 Advances the shared single-pass position.
void operator++ (int)
 Advances without retaining the previous borrowed contour.

Friends

class ContourComputation
bool operator== (const iterator &it, std::default_sentinel_t) noexcept
 Tests exhaustion against the range's sentinel.

Detailed Description

Single-pass iterator yielding (node, borrowed pixel span).

The span is valid until this iterator, or one of its copies, advances or the shared traversal is destroyed. Copies share a position; each begin() creates an independent traversal. Copy the pixels to retain a contour.

Definition at line 79 of file ContourComputation.hpp.

Member Typedef Documentation

◆ difference_type

Signed type used to represent iterator distances.

Definition at line 88 of file ContourComputation.hpp.

◆ iterator_category

Iterator category used by standard algorithms.

Definition at line 84 of file ContourComputation.hpp.

◆ iterator_concept

C++20 iterator concept for this single-pass traversal.

Definition at line 82 of file ContourComputation.hpp.

◆ value_type

Node identifier and borrowed contour span yielded by dereference.

Definition at line 86 of file ContourComputation.hpp.

Member Function Documentation

◆ operator*()

value_type mmcfilters::ContourComputation::iterator::operator* ( ) const
inlinenodiscard

Borrows the current node contour.

Returns
Current node identifier and contour span.

Definition at line 96 of file ContourComputation.hpp.

◆ operator++() [1/2]

iterator & mmcfilters::ContourComputation::iterator::operator++ ( )
inline

Advances the shared single-pass position.

Returns
This iterator after advancing.

Definition at line 107 of file ContourComputation.hpp.

◆ operator++() [2/2]

void mmcfilters::ContourComputation::iterator::operator++ ( int )
inline

Advances without retaining the previous borrowed contour.

Definition at line 116 of file ContourComputation.hpp.

◆ ContourComputation

friend class ContourComputation
friend

Definition at line 124 of file ContourComputation.hpp.

◆ operator==

bool operator== ( const iterator & it,
std::default_sentinel_t  )
friend

Tests exhaustion against the range's sentinel.

Definition at line 119 of file ContourComputation.hpp.


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