UPtrList< T >::Iterator< Const > Class Template Reference

Internally used base for iterator and const_iterator. More...

Inheritance diagram for UPtrList< T >::Iterator< Const >:

Public Types

using list_type = typename std::conditional< Const, const UPtrList< T >, UPtrList< T > >::type
 The list container type. More...
 

Public Member Functions

bool good () const noexcept
 True if iterator points to a non-null entry. More...
 
label key () const noexcept
 The iterator position/index within the list. More...
 
template<bool Any>
bool operator== (const Iterator< Any > &iter) const noexcept
 Compare hash-entry element pointers. More...
 
template<bool Any>
bool operator!= (const Iterator< Any > &iter) const noexcept
 

Protected Member Functions

constexpr Iterator () noexcept
 Default construct. Also the same as the end iterator. More...
 
 Iterator (list_type *list)
 Construct begin iterator. More...
 
void increment ()
 Increment to the next non-null position. More...
 
template<bool Any>
 operator const Iterator< Any > & () const
 Permit explicit cast to the other (const/non-const) iterator. More...
 

Protected Attributes

list_typelist_
 The parent being iterated. More...
 
label pos_
 The position within the list. More...
 

Friends

class UPtrList
 

Detailed Description

template<class T>
template<bool Const>
class Foam::UPtrList< T >::Iterator< Const >

Internally used base for iterator and const_iterator.

The iterator base for UPtrList (internal use only).

Iterates non-nullptr entries.

Definition at line 521 of file UPtrList.H.

Member Typedef Documentation

◆ list_type

using list_type = typename std::conditional < Const, const UPtrList<T>, UPtrList<T> >::type

The list container type.

Definition at line 555 of file UPtrList.H.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

constexpr Iterator ( )
inlineprotectednoexcept

Default construct. Also the same as the end iterator.

Definition at line 307 of file UPtrListI.H.

◆ Iterator() [2/2]

Iterator ( list_type list)
inlineexplicitprotected

Construct begin iterator.

Definition at line 317 of file UPtrListI.H.

Member Function Documentation

◆ increment()

void increment ( )
inlineprotected

Increment to the next non-null position.

Definition at line 333 of file UPtrListI.H.

◆ operator const Iterator< Any > &()

operator const Iterator< Any > & ( ) const
inlineexplicitprotected

Permit explicit cast to the other (const/non-const) iterator.

Definition at line 602 of file UPtrList.H.

◆ good()

bool good ( ) const
inlinenoexcept

True if iterator points to a non-null entry.

Definition at line 615 of file UPtrList.H.

Referenced by UPtrList< T >::iterator::get().

Here is the caller graph for this function:

◆ key()

label key ( ) const
inlinenoexcept

The iterator position/index within the list.

Definition at line 620 of file UPtrList.H.

◆ operator==()

bool operator== ( const Iterator< Any > &  iter) const
inlinenoexcept

Compare hash-entry element pointers.

Independent of const/non-const access

Definition at line 628 of file UPtrList.H.

◆ operator!=()

bool operator!= ( const Iterator< Any > &  iter) const
inlinenoexcept

Definition at line 634 of file UPtrList.H.

Friends And Related Function Documentation

◆ UPtrList

friend class UPtrList
friend

Definition at line 575 of file UPtrList.H.

Member Data Documentation

◆ list_

list_type* list_
protected

The parent being iterated.

Uses pointer for default copy/assignment

Definition at line 567 of file UPtrList.H.

Referenced by UPtrList< T >::iterator::get(), and UPtrList< T >::Iterator< true >::good().

◆ pos_


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