UPtrList< T >::iterator Class Reference

Forward iterator with non-const access. More...

Inheritance diagram for UPtrList< T >::iterator:
Collaboration diagram for UPtrList< T >::iterator:

Public Types

using pointer = T *
 
using reference = T &
 
- Public Types inherited from UPtrList< T >::Iterator< Const >
using list_type = typename std::conditional< Const, const UPtrList< T >, UPtrList< T > >::type
 The list container type. More...
 

Public Member Functions

constexpr iterator () noexcept=default
 Default construct - an end iterator. More...
 
 iterator (const Iterator< false > &iter)
 Copy construct from similar access type. More...
 
pointer get () const
 Pointer to the referenced object (failsafe) More...
 
reference val () const
 Reference to the object. More...
 
pointer operator-> () const
 Pointer to the referenced object. More...
 
reference operator* () const
 Reference to the object. More...
 
reference operator() () const
 Legacy call operator: reference to the object. More...
 
iteratoroperator++ ()
 Move to the next non-nullptr entry. More...
 
iterator operator++ (int)
 
- Public Member Functions inherited from UPtrList< T >::Iterator< Const >
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
 

Additional Inherited Members

- Protected Member Functions inherited from UPtrList< T >::Iterator< Const >
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 inherited from UPtrList< T >::Iterator< Const >
list_typelist_
 The parent being iterated. More...
 
label pos_
 The position within the list. More...
 

Detailed Description

template<class T>
class Foam::UPtrList< T >::iterator

Forward iterator with non-const access.

Definition at line 648 of file UPtrList.H.

Member Typedef Documentation

◆ pointer

using pointer = T*

Definition at line 653 of file UPtrList.H.

◆ reference

using reference = T&

Definition at line 654 of file UPtrList.H.

Constructor & Destructor Documentation

◆ iterator() [1/2]

constexpr iterator ( )
defaultnoexcept

Default construct - an end iterator.

◆ iterator() [2/2]

iterator ( const Iterator< false > &  iter)
inlineexplicit

Copy construct from similar access type.

Definition at line 667 of file UPtrList.H.

Member Function Documentation

◆ get()

T * get ( ) const
inline

Pointer to the referenced object (failsafe)

Definition at line 345 of file UPtrListI.H.

References UPtrList< T >::Iterator< Const >::good(), UPtrList< T >::Iterator< Const >::list_, and UPtrList< T >::Iterator< Const >::pos_.

Here is the call graph for this function:

◆ val()

T & val ( ) const
inline

Reference to the object.

Definition at line 352 of file UPtrListI.H.

Referenced by UPtrList< T >::iterator::operator()(), and UPtrList< T >::iterator::operator*().

Here is the caller graph for this function:

◆ operator->()

pointer operator-> ( ) const
inline

Pointer to the referenced object.

Definition at line 688 of file UPtrList.H.

◆ operator*()

reference operator* ( ) const
inline

Reference to the object.

Definition at line 693 of file UPtrList.H.

References UPtrList< T >::iterator::val().

Here is the call graph for this function:

◆ operator()()

reference operator() ( ) const
inline

Legacy call operator: reference to the object.

Definition at line 698 of file UPtrList.H.

References UPtrList< T >::iterator::val().

Here is the call graph for this function:

◆ operator++() [1/2]

Foam::UPtrList< T >::iterator & operator++ ( )
inline

Move to the next non-nullptr entry.

Definition at line 360 of file UPtrListI.H.

◆ operator++() [2/2]

Foam::UPtrList< T >::iterator operator++ ( int  )
inline

Definition at line 369 of file UPtrListI.H.


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