Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

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 47 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 66 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 73 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 77 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 80 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 84 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 88 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 91 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 99 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 104 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 151 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 113 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 119 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 139 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 169 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 163 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 126 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 132 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 145 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 174 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 180 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 107 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 94 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 177 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 183 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 186 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 189 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 63 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 157 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 69 of file Array.h.


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