Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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

Encapsulates a pointer to an ogdf::SList element. More...

#include <ogdf/basic/SList.h>

Public Member Functions

 SListIteratorBase ()
 Constructs an invalid iterator.
 
 SListIteratorBase (const SListIterator< E > &it)
 Copy constructor.
 
template<bool isArgConst, typename std::enable_if< isConst||!isArgConst, int >::type = 0>
 SListIteratorBase (const SListIteratorBase< E, isArgConst > &it)
 Constructs an iterator that is a copy of it.
 
 SListIteratorBase (ListElem *pX)
 Constructs an iterator that points to pX.
 
bool operator!= (const SListIteratorBase< E, isConst > &it) const
 Inequality operator.
 
Elemoperator* () const
 Returns a reference to the element content.
 
SListIteratorBase< E, isConst > & operator++ ()
 Increment operator (prefix).
 
SListIteratorBase< E, isConstoperator++ (int)
 Increment operator (postfix).
 
SListIteratorBase< E, isConst > & operator= (const SListIterator< E > &it)
 Assignment operator.
 
bool operator== (const SListIteratorBase< E, isConst > &it) const
 Equality operator.
 
SListIteratorBase< E, isConstsucc () 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 SListElement< E >, SListElement< E > >::type
 The underlying list element, depending on isConst.
 

Private Member Functions

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

Private Attributes

ListElemm_pX
 Pointer to slist element.
 

Friends

class SListIteratorBase< E, !isConst >
 
class SListPure< E >
 

Detailed Description

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

Encapsulates a pointer to an ogdf::SList element.

It is used in order to iterate over singly linked lists, and to specify a position in a singly 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.

Definition at line 92 of file SList.h.

Member Typedef Documentation

◆ Elem

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

The underlying type, depending on isConst.

Definition at line 99 of file SList.h.

◆ ListElem

template<class E , bool isConst>
using ogdf::SListIteratorBase< E, isConst >::ListElem = typename std::conditional<isConst, const SListElement<E>, SListElement<E> >::type
private

The underlying list element, depending on isConst.

Definition at line 97 of file SList.h.

Constructor & Destructor Documentation

◆ SListIteratorBase() [1/4]

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

Constructs an iterator that points to pX.

Definition at line 108 of file SList.h.

◆ SListIteratorBase() [2/4]

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

Constructs an invalid iterator.

Definition at line 111 of file SList.h.

◆ SListIteratorBase() [3/4]

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

Constructs an iterator that is a copy of it.

Definition at line 115 of file SList.h.

◆ SListIteratorBase() [4/4]

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

Copy constructor.

Definition at line 119 of file SList.h.

Member Function Documentation

◆ operator ListElem *()

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

Conversion to pointer to slist element.

Definition at line 104 of file SList.h.

◆ operator!=()

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

Inequality operator.

Definition at line 137 of file SList.h.

◆ operator*()

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

Returns a reference to the element content.

Definition at line 143 of file SList.h.

◆ operator++() [1/2]

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

Increment operator (prefix).

Definition at line 152 of file SList.h.

◆ operator++() [2/2]

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

Increment operator (postfix).

Definition at line 158 of file SList.h.

◆ operator=()

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

Assignment operator.

Definition at line 146 of file SList.h.

◆ operator==()

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

Equality operator.

Definition at line 134 of file SList.h.

◆ succ()

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

Returns successor iterator.

Definition at line 140 of file SList.h.

◆ valid()

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

Returns true iff the iterator points to an element.

Definition at line 122 of file SList.h.

Friends And Related Symbol Documentation

◆ SListIteratorBase< E, !isConst >

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

Definition at line 78 of file SList.h.

◆ SListPure< E >

template<class E , bool isConst>
friend class SListPure< E >
friend

Definition at line 78 of file SList.h.

Member Data Documentation

◆ m_pX

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

Pointer to slist element.

Definition at line 101 of file SList.h.


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