Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::ListIteratorBase< E, isConst, isReverse > Class Template Reference

Encapsulates a pointer to a list element. More...

#include <ogdf/basic/List.h>

Public Member Functions

 ListIteratorBase ()
 Constructs an invalid iterator.
 
template<bool isArgConst, typename std::enable_if< isConst||!isArgConst, int >::type = 0, bool isArgReverse>
 ListIteratorBase (const ListIteratorBase< E, isArgConst, isArgReverse > &it)
 Constructs an iterator that is a copy of it.
 
 ListIteratorBase (const ListIteratorBase< E, isConst, isReverse > &it)
 Copy constructor.
 
 ListIteratorBase (ListElem *pX)
 Constructs an iterator that points to pX.
 
bool operator!= (const ListIteratorBase< E, isConst, isReverse > &it) const
 Inequality operator.
 
Elemoperator* () const
 Returns a reference to the element content.
 
ListIteratorBase< E, isConst, isReverse > & operator++ ()
 Increment operator (prefix).
 
ListIteratorBase< E, isConst, isReverseoperator++ (int)
 Increment operator (postfix).
 
ListIteratorBase< E, isConst, isReverse > & operator-- ()
 Decrement operator (prefix).
 
ListIteratorBase< E, isConst, isReverseoperator-- (int)
 Decrement operator (postfix).
 
ListIteratorBase< E, isConst, isReverse > & operator= (const ListIteratorBase< E, isConst, isReverse > &it)
 Assignment operator.
 
bool operator== (const ListIteratorBase< E, isConst, isReverse > &it) const
 Equality operator.
 
ListIteratorBase< E, isConst, isReversepred () const
 Returns predecessor iterator.
 
ListIteratorBase< E, isConst, isReversesucc () const
 Returns successor iterator.
 
bool valid () const
 Returns true iff the iterator points to an element.
 

Private Types

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

Private Member Functions

 operator ListElem * ()
 Conversion to pointer to list element.
 

Private Attributes

ListElemm_pX
 pointer to list element
 

Friends

class ListIteratorBase< E, !isConst, !isReverse >
 
class ListIteratorBase< E, !isConst, isReverse >
 
class ListIteratorBase< E, isConst, !isReverse >
 
class ListPure< E >
 

Detailed Description

template<class E, bool isConst, bool isReverse>
class ogdf::ListIteratorBase< E, isConst, isReverse >

Encapsulates a pointer to a list element.

It is used in order to iterate over doubly linked lists, and to specify a position in a doubly linked list. 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.
isReverseTrue iff this iterator is a reverse iterator.

Definition at line 103 of file List.h.

Member Typedef Documentation

◆ Elem

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

The underlying type, depending on isConst.

Definition at line 111 of file List.h.

◆ ListElem

template<class E , bool isConst, bool isReverse>
using ogdf::ListIteratorBase< E, isConst, isReverse >::ListElem = typename std::conditional<isConst, const ListElement<E>, ListElement<E> >::type
private

The underlying list element, depending on isConst.

Definition at line 109 of file List.h.

Constructor & Destructor Documentation

◆ ListIteratorBase() [1/4]

template<class E , bool isConst, bool isReverse>
ogdf::ListIteratorBase< E, isConst, isReverse >::ListIteratorBase ( ListElem pX)
inline

Constructs an iterator that points to pX.

Definition at line 121 of file List.h.

◆ ListIteratorBase() [2/4]

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

Constructs an invalid iterator.

Definition at line 124 of file List.h.

◆ ListIteratorBase() [3/4]

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

Constructs an iterator that is a copy of it.

Definition at line 128 of file List.h.

◆ ListIteratorBase() [4/4]

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

Copy constructor.

Definition at line 133 of file List.h.

Member Function Documentation

◆ operator ListElem *()

template<class E , bool isConst, bool isReverse>
ogdf::ListIteratorBase< E, isConst, isReverse >::operator ListElem * ( )
inlineprivate

Conversion to pointer to list element.

Definition at line 117 of file List.h.

◆ operator!=()

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

Inequality operator.

Definition at line 153 of file List.h.

◆ operator*()

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

Returns a reference to the element content.

Definition at line 168 of file List.h.

◆ operator++() [1/2]

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

Increment operator (prefix).

Definition at line 178 of file List.h.

◆ operator++() [2/2]

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

Increment operator (postfix).

Definition at line 184 of file List.h.

◆ operator--() [1/2]

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

Decrement operator (prefix).

Definition at line 191 of file List.h.

◆ operator--() [2/2]

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

Decrement operator (postfix).

Definition at line 197 of file List.h.

◆ operator=()

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

Assignment operator.

Definition at line 171 of file List.h.

◆ operator==()

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

Equality operator.

Definition at line 148 of file List.h.

◆ pred()

template<class E , bool isConst, bool isReverse>
ListIteratorBase< E, isConst, isReverse > ogdf::ListIteratorBase< E, isConst, isReverse >::pred ( ) const
inline

Returns predecessor iterator.

Definition at line 163 of file List.h.

◆ succ()

template<class E , bool isConst, bool isReverse>
ListIteratorBase< E, isConst, isReverse > ogdf::ListIteratorBase< E, isConst, isReverse >::succ ( ) const
inline

Returns successor iterator.

Definition at line 158 of file List.h.

◆ valid()

template<class E , bool isConst, bool isReverse>
bool ogdf::ListIteratorBase< E, isConst, isReverse >::valid ( ) const
inline

Returns true iff the iterator points to an element.

Definition at line 137 of file List.h.

Friends And Related Symbol Documentation

◆ ListIteratorBase< E, !isConst, !isReverse >

template<class E , bool isConst, bool isReverse>
friend class ListIteratorBase< E, !isConst, !isReverse >
friend

Definition at line 89 of file List.h.

◆ ListIteratorBase< E, !isConst, isReverse >

template<class E , bool isConst, bool isReverse>
friend class ListIteratorBase< E, !isConst, isReverse >
friend

Definition at line 89 of file List.h.

◆ ListIteratorBase< E, isConst, !isReverse >

template<class E , bool isConst, bool isReverse>
friend class ListIteratorBase< E, isConst, !isReverse >
friend

Definition at line 89 of file List.h.

◆ ListPure< E >

template<class E , bool isConst, bool isReverse>
friend class ListPure< E >
friend

Definition at line 89 of file List.h.

Member Data Documentation

◆ m_pX

template<class E , bool isConst, bool isReverse>
ListElem* ogdf::ListIteratorBase< E, isConst, isReverse >::m_pX
private

pointer to list element

Definition at line 114 of file List.h.


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