Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

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

Private Member Functions

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

Private Attributes

ListElemm_pX
 Pointer to slist element. More...
 

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 39 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 92 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 90 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 101 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 104 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 108 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 112 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 97 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 132 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 140 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 149 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 155 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 143 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 127 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 137 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 115 of file SList.h.

Friends And Related Function Documentation

◆ SListIteratorBase< E, !isConst >

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

Definition at line 86 of file SList.h.

◆ SListPure< E >

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

Definition at line 87 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 94 of file SList.h.


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