Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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

Private Types

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

Private Attributes

Elemm_pX
 The pointer to the array element.
 

Friends

class ArrayReverseIteratorBase< E, !isConst >
 
ArrayReverseIteratorBase< E, isConstoperator+ (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.
 

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 69 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 73 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 80 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 84 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 87 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 91 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 96 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 100 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 108 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 113 of file Array.h.

◆ operator+()

Addition operator with int on the right-hand side.

Definition at line 160 of file Array.h.

◆ operator++() [1/2]

Increment operator (prefix).

Definition at line 122 of file Array.h.

◆ operator++() [2/2]

Increment operator (postfix).

Definition at line 128 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 148 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 178 of file Array.h.

◆ operator-() [2/2]

Subtraction operator with int on the right-hand side.

Definition at line 172 of file Array.h.

◆ operator--() [1/2]

Decrement operator (prefix).

Definition at line 135 of file Array.h.

◆ operator--() [2/2]

Decrement operator (postfix).

Definition at line 141 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 154 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 183 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 189 of file Array.h.

◆ operator=()

Assignment operator.

Definition at line 116 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 103 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 186 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 192 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 195 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 198 of file Array.h.

Friends And Related Symbol Documentation

◆ ArrayReverseIteratorBase< E, !isConst >

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

Definition at line 978 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 166 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 76 of file Array.h.


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