Enum< EnumType >::const_iterator Class Reference

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

Public Member Functions

 const_iterator (const Enum *eptr=nullptr, const label idx=0) noexcept
 Default construct, construct at given position. More...
 
const wordkey () const
 The name at the current index. More...
 
EnumType val () const
 Enumeration value at the current index. More...
 
const wordoperator* () const
 De-referencing returns the name (key) More...
 
const_iteratoroperator++ () noexcept
 Move to the next index. More...
 
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 261 of file Enum.H.

Constructor & Destructor Documentation

◆ const_iterator()

const_iterator ( const Enum eptr = nullptr,
const label  idx = 0 
)
inlineexplicitnoexcept

Default construct, construct at given position.

Definition at line 176 of file EnumI.H.

References Foam::noexcept.

Member Function Documentation

◆ key()

const Foam::word & key
inline

The name at the current index.

Definition at line 189 of file EnumI.H.

References Enum< EnumType >::names().

Here is the call graph for this function:

◆ val()

EnumType val
inline

Enumeration value at the current index.

Definition at line 196 of file EnumI.H.

◆ operator*()

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 287 of file Enum.H.

◆ operator++()

Foam::Enum< EnumType >::const_iterator & operator++
inlinenoexcept

Move to the next index.

Definition at line 204 of file EnumI.H.

◆ operator==()

bool operator== ( const const_iterator iter) const
inlinenoexcept

Definition at line 212 of file EnumI.H.

◆ operator!=()

bool operator!= ( const const_iterator iter) const
inlinenoexcept

Definition at line 222 of file EnumI.H.


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