Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst > Class Template Reference

Iterator for registered arrays. More...

#include <ogdf/basic/RegisteredArray.h>

Public Types

using array_pointer_type = typename std::conditional< isConst, const ArrayType *, ArrayType * >::type
 
using key_type = typename ArrayType::key_type
 
using registry_type = typename ArrayType::registry_type
 
using value_type = typename std::conditional< isConst, const typename ArrayType::value_type, typename ArrayType::value_type >::type
 

Public Member Functions

 RegisteredArrayIterator ()
 Creates a new iterator associated with no array. More...
 
 RegisteredArrayIterator (KeyIterator mIt, array_pointer_type mArray)
 Creates a new iterator. More...
 
key_type key () const
 Returns the current key. More...
 
bool operator!= (const RegisteredArrayIterator< ArrayType, KeyIterator, isConst > &iter) const
 Inequality operator. More...
 
value_typeoperator* () const
 Returns the value of key() in the registered array. More...
 
RegisteredArrayIterator< ArrayType, KeyIterator, isConst > & operator++ ()
 Increment operator (prefix). More...
 
RegisteredArrayIterator< ArrayType, KeyIterator, isConst > operator++ (int)
 Increment operator (postfix). More...
 
RegisteredArrayIterator< ArrayType, KeyIterator, isConst > & operator-- ()
 Decrement operator (prefix). More...
 
RegisteredArrayIterator< ArrayType, KeyIterator, isConst > operator-- (int)
 Decrement operator (postfix). More...
 
bool operator== (const RegisteredArrayIterator< ArrayType, KeyIterator, isConst > &iter) const
 Equality operator. More...
 
value_typevalue () const
 Returns the value of key() in the registered array. More...
 

Private Attributes

array_pointer_type m_array
 
KeyIterator m_it
 

Detailed Description

template<class ArrayType, class KeyIterator, bool isConst = false>
class ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >

Iterator for registered arrays.

Provides an iterator for the key-value pairs stored in registered arrays.

Template Parameters
ArrayTypeThe type of registered array.
KeyIteratorAn iterator for the keys in the registry. Determines the order of the key-value pairs.
isConstWhether the iterator allows modifying the data or not.

Definition at line 353 of file RegisteredArray.h.

Member Typedef Documentation

◆ array_pointer_type

template<class ArrayType , class KeyIterator , bool isConst = false>
using ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::array_pointer_type = typename std::conditional<isConst, const ArrayType*, ArrayType*>::type

Definition at line 359 of file RegisteredArray.h.

◆ key_type

template<class ArrayType , class KeyIterator , bool isConst = false>
using ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::key_type = typename ArrayType::key_type

Definition at line 356 of file RegisteredArray.h.

◆ registry_type

template<class ArrayType , class KeyIterator , bool isConst = false>
using ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::registry_type = typename ArrayType::registry_type

Definition at line 355 of file RegisteredArray.h.

◆ value_type

template<class ArrayType , class KeyIterator , bool isConst = false>
using ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::value_type = typename std::conditional<isConst, const typename ArrayType::value_type, typename ArrayType::value_type>::type

Definition at line 358 of file RegisteredArray.h.

Constructor & Destructor Documentation

◆ RegisteredArrayIterator() [1/2]

template<class ArrayType , class KeyIterator , bool isConst = false>
ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::RegisteredArrayIterator ( )
inline

Creates a new iterator associated with no array.

Definition at line 367 of file RegisteredArray.h.

◆ RegisteredArrayIterator() [2/2]

template<class ArrayType , class KeyIterator , bool isConst = false>
ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::RegisteredArrayIterator ( KeyIterator  mIt,
array_pointer_type  mArray 
)
inline

Creates a new iterator.

Parameters
mItAn iterator pointing to the current key.
mArrayA pointer to the registered array containing the desired values.

Definition at line 374 of file RegisteredArray.h.

Member Function Documentation

◆ key()

template<class ArrayType , class KeyIterator , bool isConst = false>
key_type ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::key ( ) const
inline

Returns the current key.

Definition at line 378 of file RegisteredArray.h.

◆ operator!=()

template<class ArrayType , class KeyIterator , bool isConst = false>
bool ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::operator!= ( const RegisteredArrayIterator< ArrayType, KeyIterator, isConst > &  iter) const
inline

Inequality operator.

Definition at line 392 of file RegisteredArray.h.

◆ operator*()

template<class ArrayType , class KeyIterator , bool isConst = false>
value_type& ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::operator* ( ) const
inline

Returns the value of key() in the registered array.

Definition at line 384 of file RegisteredArray.h.

◆ operator++() [1/2]

template<class ArrayType , class KeyIterator , bool isConst = false>
RegisteredArrayIterator<ArrayType, KeyIterator, isConst>& ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::operator++ ( )
inline

Increment operator (prefix).

Definition at line 397 of file RegisteredArray.h.

◆ operator++() [2/2]

template<class ArrayType , class KeyIterator , bool isConst = false>
RegisteredArrayIterator<ArrayType, KeyIterator, isConst> ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::operator++ ( int  )
inline

Increment operator (postfix).

Definition at line 403 of file RegisteredArray.h.

◆ operator--() [1/2]

template<class ArrayType , class KeyIterator , bool isConst = false>
RegisteredArrayIterator<ArrayType, KeyIterator, isConst>& ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::operator-- ( )
inline

Decrement operator (prefix).

Definition at line 410 of file RegisteredArray.h.

◆ operator--() [2/2]

template<class ArrayType , class KeyIterator , bool isConst = false>
RegisteredArrayIterator<ArrayType, KeyIterator, isConst> ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::operator-- ( int  )
inline

Decrement operator (postfix).

Definition at line 416 of file RegisteredArray.h.

◆ operator==()

template<class ArrayType , class KeyIterator , bool isConst = false>
bool ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::operator== ( const RegisteredArrayIterator< ArrayType, KeyIterator, isConst > &  iter) const
inline

Equality operator.

Definition at line 387 of file RegisteredArray.h.

◆ value()

template<class ArrayType , class KeyIterator , bool isConst = false>
value_type& ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::value ( ) const
inline

Returns the value of key() in the registered array.

Definition at line 381 of file RegisteredArray.h.

Member Data Documentation

◆ m_array

template<class ArrayType , class KeyIterator , bool isConst = false>
array_pointer_type ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::m_array
private

Definition at line 363 of file RegisteredArray.h.

◆ m_it

template<class ArrayType , class KeyIterator , bool isConst = false>
KeyIterator ogdf::RegisteredArrayIterator< ArrayType, KeyIterator, isConst >::m_it
private

Definition at line 362 of file RegisteredArray.h.


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