Loading...
Searching...
No Matches
Enum< EnumType >::const_iterator Class Reference

A const_iterator for iterating an Enum list. More...

#include <Enum.H>

Public Member Functions

 const_iterator (const Enum *eptr=nullptr, const label idx=0) noexcept
 Default construct, construct at given position.
bool good () const noexcept
 True if iterator points to an entry.
const wordkey () const
 The name at the current index.
EnumType val () const
 Enumeration value at the current index.
 operator bool () const noexcept
 True if iterator points to an entry.
const wordoperator* () const
 De-referencing returns the name (key).
const_iteratoroperator++ () noexcept
 Move to the next index.
bool operator== (const const_iterator &iter) const noexcept
bool operator!= (const const_iterator &iter) const noexcept

Detailed Description

template<class EnumType>
class Foam::Enum< EnumType >::const_iterator

A const_iterator for iterating an Enum list.

Note
The iterator dereference returns the key

Definition at line 326 of file Enum.H.

Constructor & Destructor Documentation

◆ const_iterator()

template<class EnumType>
const_iterator ( const Enum * eptr = nullptr,
const label idx = 0 )
inlineexplicitnoexcept

Default construct, construct at given position.

Definition at line 156 of file EnumI.H.

References Enum< EnumType >::Enum(), and Foam::noexcept.

Referenced by operator!=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ good()

template<class EnumType>
bool good ( ) const
inlinenoexcept

True if iterator points to an entry.

Definition at line 183 of file EnumI.H.

References Foam::noexcept, and Enum< EnumType >::size().

Referenced by operator bool().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ key()

template<class EnumType>
const Foam::word & key ( ) const
inline

The name at the current index.

Definition at line 169 of file EnumI.H.

Referenced by Enum< EnumType >::find(), Enum< EnumType >::found(), Enum< EnumType >::get(), Enum< EnumType >::lookup(), Enum< EnumType >::lookupOrDefault(), Enum< EnumType >::operator()(), and operator*().

Here is the caller graph for this function:

◆ val()

template<class EnumType>
EnumType val ( ) const
inline

Enumeration value at the current index.

Definition at line 176 of file EnumI.H.

◆ operator bool()

template<class EnumType>
operator bool ( ) const
inlineexplicitnoexcept

True if iterator points to an entry.

Definition at line 360 of file Enum.H.

References good(), and Foam::noexcept.

Here is the call graph for this function:

◆ operator*()

template<class EnumType>
const word & operator* ( ) const
inline

De-referencing returns the name (key).

This is similar to HashSet (not HashTable!) and allows convenient output and traversing of the names

Definition at line 368 of file Enum.H.

References key().

Here is the call graph for this function:

◆ operator++()

template<class EnumType>
Foam::Enum< EnumType >::const_iterator & operator++ ( )
inlinenoexcept

Move to the next index.

Definition at line 191 of file EnumI.H.

References Foam::noexcept.

◆ operator==()

template<class EnumType>
bool operator== ( const const_iterator & iter) const
inlinenoexcept

Definition at line 199 of file EnumI.H.

References const_iterator().

Here is the call graph for this function:

◆ operator!=()

template<class EnumType>
bool operator!= ( const const_iterator & iter) const
inlinenoexcept

Definition at line 209 of file EnumI.H.

References const_iterator().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
  • src/OpenFOAM/primitives/enums/Enum.H
  • src/OpenFOAM/primitives/enums/EnumI.H