ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::IndexRange< VDimension, VBeginAtZero >::const_iterator Class Referencefinal

#include <itkIndexRange.h>

Detailed Description

template<unsigned int VDimension, bool VBeginAtZero>
class itk::IndexRange< VDimension, VBeginAtZero >::const_iterator

Definition at line 84 of file itkIndexRange.h.

+ Collaboration diagram for itk::IndexRange< VDimension, VBeginAtZero >::const_iterator:

Classes

struct  ZeroIndex
 

Public Types

using difference_type = ptrdiff_t
 
using iterator_category = std::bidirectional_iterator_tag
 
using pointer = const IndexType *
 
using reference = const IndexType &
 
using value_type = IndexType
 

Public Member Functions

 const_iterator ()=default
 
constexpr reference operator* () const noexcept
 
constexpr const_iteratoroperator++ () noexcept
 
constexpr const_iterator operator++ (int) noexcept
 
constexpr const_iteratoroperator-- () noexcept
 
constexpr const_iterator operator-- (int) noexcept
 
constexpr pointer operator-> () const noexcept
 

Private Types

using MinIndexType = std::conditional_t<VBeginAtZero, ZeroIndex, IndexType>
 

Private Member Functions

constexpr const_iterator (const IndexType &index, const MinIndexType &minIndex, const IndexType &maxIndex, const vcl_size_t position) noexcept
 

Private Attributes

IndexType m_Index
 
IndexType m_MaxIndex
 
MinIndexType m_MinIndex
 
vcl_size_t m_Position {}
 

Friends

class IndexRange
 
bool operator!= (const const_iterator &lhs, const const_iterator &rhs) noexcept
 
constexpr bool operator< (const const_iterator &lhs, const const_iterator &rhs) noexcept
 
constexpr bool operator<= (const const_iterator &lhs, const const_iterator &rhs) noexcept
 
bool operator== (const const_iterator &lhs, const const_iterator &rhs) noexcept
 
constexpr bool operator> (const const_iterator &lhs, const const_iterator &rhs) noexcept
 
constexpr bool operator>= (const const_iterator &lhs, const const_iterator &rhs) noexcept
 

Member Typedef Documentation

◆ difference_type

template<unsigned int VDimension, bool VBeginAtZero>
using itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::difference_type = ptrdiff_t

Definition at line 88 of file itkIndexRange.h.

◆ iterator_category

template<unsigned int VDimension, bool VBeginAtZero>
using itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::iterator_category = std::bidirectional_iterator_tag

Definition at line 92 of file itkIndexRange.h.

◆ MinIndexType

template<unsigned int VDimension, bool VBeginAtZero>
using itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::MinIndexType = std::conditional_t<VBeginAtZero, ZeroIndex, IndexType>
private

Definition at line 269 of file itkIndexRange.h.

◆ pointer

template<unsigned int VDimension, bool VBeginAtZero>
using itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::pointer = const IndexType *

Definition at line 91 of file itkIndexRange.h.

◆ reference

template<unsigned int VDimension, bool VBeginAtZero>
using itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::reference = const IndexType &

Definition at line 90 of file itkIndexRange.h.

◆ value_type

template<unsigned int VDimension, bool VBeginAtZero>
using itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::value_type = IndexType

Definition at line 89 of file itkIndexRange.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

template<unsigned int VDimension, bool VBeginAtZero>
itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::const_iterator ( )
default

Default-constructor, as required for any C++11 Forward Iterator.

Note
The other five "special member functions" (copy-constructor, copy-assignment operator, move-constructor, move-assignment operator, and destructor) are defaulted implicitly, following the C++ "Rule of Zero".

Referenced by operator!=, operator<, operator<=, operator==, operator>, and operator>=.

◆ const_iterator() [2/2]

template<unsigned int VDimension, bool VBeginAtZero>
itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::const_iterator ( const IndexType & index,
const MinIndexType & minIndex,
const IndexType & maxIndex,
const vcl_size_t position )
inlineconstexprprivatenoexcept

Definition at line 272 of file itkIndexRange.h.

Member Function Documentation

◆ operator*()

template<unsigned int VDimension, bool VBeginAtZero>
reference itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::operator* ( ) const
inlineconstexprnoexcept

Returns a reference to the current index.

Definition at line 104 of file itkIndexRange.h.

References m_Index.

◆ operator++() [1/2]

template<unsigned int VDimension, bool VBeginAtZero>
const_iterator & itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::operator++ ( )
inlineconstexprnoexcept

Prefix increment ('++it').

Definition at line 120 of file itkIndexRange.h.

References m_Index, m_MaxIndex, m_MinIndex, and m_Position.

◆ operator++() [2/2]

template<unsigned int VDimension, bool VBeginAtZero>
const_iterator itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::operator++ ( int )
inlineconstexprnoexcept

Postfix increment ('it++').

Note
Usually prefix increment ('++it') is preferable.

Definition at line 145 of file itkIndexRange.h.

◆ operator--() [1/2]

template<unsigned int VDimension, bool VBeginAtZero>
const_iterator & itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::operator-- ( )
inlineconstexprnoexcept

Prefix decrement ('–it').

Definition at line 155 of file itkIndexRange.h.

References m_Index, m_MaxIndex, m_MinIndex, and m_Position.

◆ operator--() [2/2]

template<unsigned int VDimension, bool VBeginAtZero>
const_iterator itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::operator-- ( int )
inlineconstexprnoexcept

Postfix increment ('it–').

Note
Usually prefix increment ('–it') is preferable.

Definition at line 179 of file itkIndexRange.h.

◆ operator->()

template<unsigned int VDimension, bool VBeginAtZero>
pointer itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::operator-> ( ) const
inlineconstexprnoexcept

Returns a pointer to the current index.

Definition at line 112 of file itkIndexRange.h.

Friends And Related Symbol Documentation

◆ IndexRange

template<unsigned int VDimension, bool VBeginAtZero>
friend class IndexRange
friend

Definition at line 246 of file itkIndexRange.h.

References IndexRange.

Referenced by IndexRange.

◆ operator!=

template<unsigned int VDimension, bool VBeginAtZero>
bool operator!= ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Returns (it1 != it2) for iterators it1 and it2.

Definition at line 203 of file itkIndexRange.h.

References const_iterator().

◆ operator<

template<unsigned int VDimension, bool VBeginAtZero>
bool operator< ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Returns (it1 < it2) for iterators it1 and it2.

Definition at line 211 of file itkIndexRange.h.

References const_iterator().

◆ operator<=

template<unsigned int VDimension, bool VBeginAtZero>
bool operator<= ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Returns (it1 <= it2) for iterators it1 and it2.

Definition at line 228 of file itkIndexRange.h.

References const_iterator().

◆ operator==

template<unsigned int VDimension, bool VBeginAtZero>
bool operator== ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Returns (it1 == it2) for iterators it1 and it2. Note that these iterators should be from the same range. This operator does not support comparing iterators from different ranges.

Definition at line 191 of file itkIndexRange.h.

References const_iterator().

◆ operator>

template<unsigned int VDimension, bool VBeginAtZero>
bool operator> ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Returns (it1 > it2) for iterators it1 and it2.

Definition at line 220 of file itkIndexRange.h.

References const_iterator().

◆ operator>=

template<unsigned int VDimension, bool VBeginAtZero>
bool operator>= ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Returns (it1 >= it2) for iterators it1 and it2.

Definition at line 238 of file itkIndexRange.h.

References const_iterator().

Member Data Documentation

◆ m_Index

template<unsigned int VDimension, bool VBeginAtZero>
IndexType itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::m_Index
private

Definition at line 288 of file itkIndexRange.h.

Referenced by operator*(), operator++(), and operator--().

◆ m_MaxIndex

template<unsigned int VDimension, bool VBeginAtZero>
IndexType itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::m_MaxIndex
private

Definition at line 294 of file itkIndexRange.h.

Referenced by operator++(), and operator--().

◆ m_MinIndex

template<unsigned int VDimension, bool VBeginAtZero>
MinIndexType itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::m_MinIndex
private

Definition at line 291 of file itkIndexRange.h.

Referenced by operator++(), and operator--().

◆ m_Position

template<unsigned int VDimension, bool VBeginAtZero>
vcl_size_t itk::IndexRange< VDimension, VBeginAtZero >::const_iterator::m_Position {}
private

Definition at line 298 of file itkIndexRange.h.

Referenced by operator++(), and operator--().


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