Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

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. More...
 
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. More...
 
 ListIteratorBase (const ListIteratorBase< E, isConst, isReverse > &it)
 Copy constructor. More...
 
 ListIteratorBase (ListElem *pX)
 Constructs an iterator that points to pX. More...
 
bool operator!= (const ListIteratorBase< E, isConst, isReverse > &it) const
 Inequality operator. More...
 
Elemoperator* () const
 Returns a reference to the element content. More...
 
ListIteratorBase< E, isConst, isReverse > & operator++ ()
 Increment operator (prefix). More...
 
ListIteratorBase< E, isConst, isReverse > operator++ (int)
 Increment operator (postfix). More...
 
ListIteratorBase< E, isConst, isReverse > & operator-- ()
 Decrement operator (prefix). More...
 
ListIteratorBase< E, isConst, isReverse > operator-- (int)
 Decrement operator (postfix). More...
 
ListIteratorBase< E, isConst, isReverse > & operator= (const ListIteratorBase< E, isConst, isReverse > &it)
 Assignment operator. More...
 
bool operator== (const ListIteratorBase< E, isConst, isReverse > &it) const
 Equality operator. More...
 
ListIteratorBase< E, isConst, isReverse > pred () const
 Returns predecessor iterator. More...
 
ListIteratorBase< E, isConst, isReverse > succ () const
 Returns successor iterator. More...
 
bool valid () const
 Returns true iff the iterator points to an element. More...
 

Private Types

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

Private Member Functions

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

Private Attributes

ListElemm_pX
 pointer to list element More...
 

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 42 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 100 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 98 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 110 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 113 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 117 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 121 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 106 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 140 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 155 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 164 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 170 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 177 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 183 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 158 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 135 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 150 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 145 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 124 of file List.h.

Friends And Related Function Documentation

◆ ListIteratorBase< E, !isConst, !isReverse >

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

Definition at line 95 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 93 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 94 of file List.h.

◆ ListPure< E >

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

Definition at line 96 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 103 of file List.h.


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