MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
maia::RangeIterator Struct Reference

Dummy iterator class. More...

#include <parallelfor.h>

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using value_type = MInt
 
using pointer = MInt *
 
using reference = MInt &
 

Public Member Functions

 RangeIterator (value_type value)
 
reference operator* () const
 
pointer operator-> ()
 
RangeIteratoroperator++ ()
 
RangeIterator operator++ (MInt)
 
RangeIteratoroperator-- ()
 
RangeIterator operator-- (MInt)
 

Private Attributes

MInt m_value
 

Friends

MBool operator== (const RangeIterator &a, const RangeIterator &b)
 
MBool operator!= (const RangeIterator &a, const RangeIterator &b)
 
MBool operator> (const RangeIterator &a, const RangeIterator &b)
 

Detailed Description

Author
Miro Gondrum
Date
02.12.2021

This class is of forward iterator type without really iterating over an STL. It is only holding an integer to be in-/decreased. Purpose: To provide a range for std::for_each without explicitly creating a dummy array only containing a certain integer range.

Note
The usage for other purpose might be critical as it is not pointing to a real container.

Definition at line 45 of file parallelfor.h.

Member Typedef Documentation

◆ difference_type

using maia::RangeIterator::difference_type = std::ptrdiff_t

Definition at line 47 of file parallelfor.h.

◆ iterator_category

using maia::RangeIterator::iterator_category = std::forward_iterator_tag

Definition at line 46 of file parallelfor.h.

◆ pointer

Definition at line 49 of file parallelfor.h.

◆ reference

Definition at line 50 of file parallelfor.h.

◆ value_type

Definition at line 48 of file parallelfor.h.

Constructor & Destructor Documentation

◆ RangeIterator()

maia::RangeIterator::RangeIterator ( value_type  value)
inline

Definition at line 52 of file parallelfor.h.

52: m_value(value) {}

Member Function Documentation

◆ operator*()

reference maia::RangeIterator::operator* ( ) const
inline

Definition at line 55 of file parallelfor.h.

55 {
57 return *p;
58 }
constexpr std::underlying_type< FcCell >::type p(const FcCell property)
Converts property name to underlying integer value.

◆ operator++() [1/2]

RangeIterator & maia::RangeIterator::operator++ ( )
inline

Definition at line 62 of file parallelfor.h.

62 {
63 m_value++;
64 return *this;
65 }

◆ operator++() [2/2]

RangeIterator maia::RangeIterator::operator++ ( MInt  )
inline

Definition at line 66 of file parallelfor.h.

66 {
67 RangeIterator tmp = *this;
68 ++(*this);
69 return tmp;
70 }
RangeIterator(value_type value)
Definition: parallelfor.h:52

◆ operator--() [1/2]

RangeIterator & maia::RangeIterator::operator-- ( )
inline

Definition at line 72 of file parallelfor.h.

72 {
73 m_value--;
74 return *this;
75 }

◆ operator--() [2/2]

RangeIterator maia::RangeIterator::operator-- ( MInt  )
inline

Definition at line 76 of file parallelfor.h.

76 {
77 RangeIterator tmp = *this;
78 --(*this);
79 return tmp;
80 }

◆ operator->()

pointer maia::RangeIterator::operator-> ( )
inline

Definition at line 59 of file parallelfor.h.

59{ return &m_value; }

Friends And Related Function Documentation

◆ operator!=

MBool operator!= ( const RangeIterator a,
const RangeIterator b 
)
friend

Definition at line 84 of file parallelfor.h.

84{ return a.m_value != b.m_value; };
Definition: contexttypes.h:19

◆ operator==

MBool operator== ( const RangeIterator a,
const RangeIterator b 
)
friend

Definition at line 83 of file parallelfor.h.

83{ return a.m_value == b.m_value; };

◆ operator>

MBool operator> ( const RangeIterator a,
const RangeIterator b 
)
friend

Definition at line 85 of file parallelfor.h.

85{ return a.m_value > b.m_value; };

Member Data Documentation

◆ m_value

MInt maia::RangeIterator::m_value
private

Definition at line 88 of file parallelfor.h.


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