Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::ArrayReverseIteratorBase< E, isConst > Class Template Reference

Random-access reverse iterator based on a pointer to an array element. More...

#include <ogdf/basic/Array.h>

Public Member Functions

 ArrayReverseIteratorBase ()
 Constructs an invalid iterator. More...
 
template<bool isArgConst, typename std::enable_if< isConst||!isArgConst, int >::type = 0>
 ArrayReverseIteratorBase (const ArrayReverseIteratorBase< E, isArgConst > &it)
 Constructs an iterator that is a copy of it. More...
 
 ArrayReverseIteratorBase (const ArrayReverseIteratorBase< E, isConst > &it)
 Copy constructor. clang10 does not see the above templated one match this case and requires it explicitly. More...
 
template<bool isConstSFINAE = isConst, typename std::enable_if< isConstSFINAE, int >::type = 0>
 ArrayReverseIteratorBase (const E *pX)
 Constructs an iterator that points to const E* pX. More...
 
 ArrayReverseIteratorBase (E *pX)
 Constructs an iterator that points to E* pX. More...
 
 operator std::conditional< isConst, const E, E > * () const
 Implicit cast to (const) E*. More...
 
bool operator!= (const ArrayReverseIteratorBase< E, isConst > &it) const
 Inequality operator. More...
 
Elemoperator* () const
 Returns the element this iterator points to. More...
 
ArrayReverseIteratorBase< E, isConst > operator+ (const int &rhs)
 Addition operator with int on the right-hand side. More...
 
ArrayReverseIteratorBase< E, isConst > & operator++ ()
 Increment operator (prefix). More...
 
ArrayReverseIteratorBase< E, isConst > operator++ (int)
 Increment operator (postfix). More...
 
ArrayReverseIteratorBase< E, isConst > & operator+= (const int &rhs)
 Compound assignment operator (+). More...
 
template<bool isArgConst>
int operator- (ArrayReverseIteratorBase< E, isArgConst > &rhs)
 Subtraction operator. More...
 
ArrayReverseIteratorBase< E, isConst > operator- (const int &rhs)
 Subtraction operator with int on the right-hand side. More...
 
ArrayReverseIteratorBase< E, isConst > & operator-- ()
 Decrement operator (prefix). More...
 
ArrayReverseIteratorBase< E, isConst > operator-- (int)
 Decrement operator (postfix). More...
 
ArrayReverseIteratorBase< E, isConst > & operator-= (const int &rhs)
 Compound assignment operator (-). More...
 
bool operator< (ArrayReverseIteratorBase< E, isConst > &it) const
 Less-than operator. More...
 
bool operator<= (ArrayReverseIteratorBase< E, isConst > &it) const
 Less-than-or-equals operator. More...
 
ArrayReverseIteratorBase< E, isConst > & operator= (const ArrayReverseIteratorBase< E, isConst > &it)
 Assignment operator. More...
 
bool operator== (const ArrayReverseIteratorBase< E, isConst > &it) const
 Equality operator. More...
 
bool operator> (ArrayReverseIteratorBase< E, isConst > &it) const
 Greater-than operator. More...
 
bool operator>= (ArrayReverseIteratorBase< E, isConst > &it) const
 Greater-than-or-equals operator. More...
 
Elemoperator[] (std::size_t idx)
 Member access operator. More...
 
const Elemoperator[] (std::size_t idx) const
 Const member access operator. More...
 

Private Types

using Elem = typename std::conditional< isConst, const E, E >::type
 The underlying element, depending on isConst. More...
 

Private Attributes

Elemm_pX
 The pointer to the array element. More...
 

Friends

class ArrayReverseIteratorBase< E, !isConst >
 
ArrayReverseIteratorBase< E, isConst > operator+ (const int &lhs, ArrayReverseIteratorBase< E, isConst > rhs)
 Addition operator with int on the left-hand side. Returns the same result as addition with int on the right-hand side. More...
 

Detailed Description

template<class E, bool isConst>
class ogdf::ArrayReverseIteratorBase< E, isConst >

Random-access reverse iterator based on a pointer to an array element.

Swaps all operations involving an increment of the pointer by operations involving a decrement, and vice versa. Moreover, the relational operators are swapped as well. It is possible that an iterator encapsulates a null pointer.

Template Parameters
EThe type of element.
isConstTrue iff this iterator allows only const-access to the element.

Definition at line 51 of file Array.h.

Member Typedef Documentation

◆ Elem

template<class E , bool isConst>
using ogdf::ArrayReverseIteratorBase< E, isConst >::Elem = typename std::conditional<isConst, const E, E>::type
private

The underlying element, depending on isConst.

Definition at line 78 of file Array.h.

Constructor & Destructor Documentation

◆ ArrayReverseIteratorBase() [1/5]

template<class E , bool isConst>
ogdf::ArrayReverseIteratorBase< E, isConst >::ArrayReverseIteratorBase ( E *  pX)
inline

Constructs an iterator that points to E* pX.

Definition at line 85 of file Array.h.

◆ ArrayReverseIteratorBase() [2/5]

template<class E , bool isConst>
template<bool isConstSFINAE = isConst, typename std::enable_if< isConstSFINAE, int >::type = 0>
ogdf::ArrayReverseIteratorBase< E, isConst >::ArrayReverseIteratorBase ( const E *  pX)
inline

Constructs an iterator that points to const E* pX.

Definition at line 89 of file Array.h.

◆ ArrayReverseIteratorBase() [3/5]

template<class E , bool isConst>
ogdf::ArrayReverseIteratorBase< E, isConst >::ArrayReverseIteratorBase ( )
inline

Constructs an invalid iterator.

Definition at line 92 of file Array.h.

◆ ArrayReverseIteratorBase() [4/5]

template<class E , bool isConst>
template<bool isArgConst, typename std::enable_if< isConst||!isArgConst, int >::type = 0>
ogdf::ArrayReverseIteratorBase< E, isConst >::ArrayReverseIteratorBase ( const ArrayReverseIteratorBase< E, isArgConst > &  it)
inline

Constructs an iterator that is a copy of it.

Definition at line 96 of file Array.h.

◆ ArrayReverseIteratorBase() [5/5]

template<class E , bool isConst>
ogdf::ArrayReverseIteratorBase< E, isConst >::ArrayReverseIteratorBase ( const ArrayReverseIteratorBase< E, isConst > &  it)
inline

Copy constructor. clang10 does not see the above templated one match this case and requires it explicitly.

Definition at line 101 of file Array.h.

Member Function Documentation

◆ operator std::conditional< isConst, const E, E > *()

template<class E , bool isConst>
ogdf::ArrayReverseIteratorBase< E, isConst >::operator std::conditional< isConst, const E, E > * ( ) const
inline

Implicit cast to (const) E*.

Definition at line 105 of file Array.h.

◆ operator!=()

template<class E , bool isConst>
bool ogdf::ArrayReverseIteratorBase< E, isConst >::operator!= ( const ArrayReverseIteratorBase< E, isConst > &  it) const
inline

Inequality operator.

Definition at line 113 of file Array.h.

◆ operator*()

template<class E , bool isConst>
Elem& ogdf::ArrayReverseIteratorBase< E, isConst >::operator* ( ) const
inline

Returns the element this iterator points to.

Definition at line 118 of file Array.h.

◆ operator+()

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst> ogdf::ArrayReverseIteratorBase< E, isConst >::operator+ ( const int &  rhs)
inline

Addition operator with int on the right-hand side.

Definition at line 165 of file Array.h.

◆ operator++() [1/2]

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst>& ogdf::ArrayReverseIteratorBase< E, isConst >::operator++ ( )
inline

Increment operator (prefix).

Definition at line 127 of file Array.h.

◆ operator++() [2/2]

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst> ogdf::ArrayReverseIteratorBase< E, isConst >::operator++ ( int  )
inline

Increment operator (postfix).

Definition at line 133 of file Array.h.

◆ operator+=()

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst>& ogdf::ArrayReverseIteratorBase< E, isConst >::operator+= ( const int &  rhs)
inline

Compound assignment operator (+).

Definition at line 153 of file Array.h.

◆ operator-() [1/2]

template<class E , bool isConst>
template<bool isArgConst>
int ogdf::ArrayReverseIteratorBase< E, isConst >::operator- ( ArrayReverseIteratorBase< E, isArgConst > &  rhs)
inline

Subtraction operator.

Definition at line 183 of file Array.h.

◆ operator-() [2/2]

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst> ogdf::ArrayReverseIteratorBase< E, isConst >::operator- ( const int &  rhs)
inline

Subtraction operator with int on the right-hand side.

Definition at line 177 of file Array.h.

◆ operator--() [1/2]

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst>& ogdf::ArrayReverseIteratorBase< E, isConst >::operator-- ( )
inline

Decrement operator (prefix).

Definition at line 140 of file Array.h.

◆ operator--() [2/2]

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst> ogdf::ArrayReverseIteratorBase< E, isConst >::operator-- ( int  )
inline

Decrement operator (postfix).

Definition at line 146 of file Array.h.

◆ operator-=()

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst>& ogdf::ArrayReverseIteratorBase< E, isConst >::operator-= ( const int &  rhs)
inline

Compound assignment operator (-).

Definition at line 159 of file Array.h.

◆ operator<()

template<class E , bool isConst>
bool ogdf::ArrayReverseIteratorBase< E, isConst >::operator< ( ArrayReverseIteratorBase< E, isConst > &  it) const
inline

Less-than operator.

Definition at line 188 of file Array.h.

◆ operator<=()

template<class E , bool isConst>
bool ogdf::ArrayReverseIteratorBase< E, isConst >::operator<= ( ArrayReverseIteratorBase< E, isConst > &  it) const
inline

Less-than-or-equals operator.

Definition at line 194 of file Array.h.

◆ operator=()

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst>& ogdf::ArrayReverseIteratorBase< E, isConst >::operator= ( const ArrayReverseIteratorBase< E, isConst > &  it)
inline

Assignment operator.

Definition at line 121 of file Array.h.

◆ operator==()

template<class E , bool isConst>
bool ogdf::ArrayReverseIteratorBase< E, isConst >::operator== ( const ArrayReverseIteratorBase< E, isConst > &  it) const
inline

Equality operator.

Definition at line 108 of file Array.h.

◆ operator>()

template<class E , bool isConst>
bool ogdf::ArrayReverseIteratorBase< E, isConst >::operator> ( ArrayReverseIteratorBase< E, isConst > &  it) const
inline

Greater-than operator.

Definition at line 191 of file Array.h.

◆ operator>=()

template<class E , bool isConst>
bool ogdf::ArrayReverseIteratorBase< E, isConst >::operator>= ( ArrayReverseIteratorBase< E, isConst > &  it) const
inline

Greater-than-or-equals operator.

Definition at line 197 of file Array.h.

◆ operator[]() [1/2]

template<class E , bool isConst>
Elem& ogdf::ArrayReverseIteratorBase< E, isConst >::operator[] ( std::size_t  idx)
inline

Member access operator.

Definition at line 200 of file Array.h.

◆ operator[]() [2/2]

template<class E , bool isConst>
const Elem& ogdf::ArrayReverseIteratorBase< E, isConst >::operator[] ( std::size_t  idx) const
inline

Const member access operator.

Definition at line 203 of file Array.h.

Friends And Related Function Documentation

◆ ArrayReverseIteratorBase< E, !isConst >

template<class E , bool isConst>
friend class ArrayReverseIteratorBase< E, !isConst >
friend

Definition at line 75 of file Array.h.

◆ operator+

template<class E , bool isConst>
ArrayReverseIteratorBase<E, isConst> operator+ ( const int &  lhs,
ArrayReverseIteratorBase< E, isConst >  rhs 
)
friend

Addition operator with int on the left-hand side. Returns the same result as addition with int on the right-hand side.

Definition at line 171 of file Array.h.

Member Data Documentation

◆ m_pX

template<class E , bool isConst>
Elem* ogdf::ArrayReverseIteratorBase< E, isConst >::m_pX
private

The pointer to the array element.

Definition at line 81 of file Array.h.


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