Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values. All dictionary searches use a literal (not regex). More...
Classes | |
class | const_iterator |
Public Types | |
typedef word | key_type |
typedef EnumType | value_type |
Public Member Functions | |
Enum () noexcept=default | |
Enum (std::initializer_list< std::pair< EnumType, const char * >> list) | |
bool | empty () const noexcept |
label | size () const noexcept |
const List< word > & | names () const noexcept |
const List< int > & | values () const noexcept |
const List< word > & | toc () const noexcept |
List< word > | sortedToc () const |
void | clear () |
void | append (std::initializer_list< std::pair< EnumType, const char * >> list) |
label | find (const word &enumName) const |
label | find (const EnumType e) const |
bool | found (const word &enumName) const |
bool | found (const EnumType e) const |
EnumType | get (const word &enumName) const |
const word & | get (const EnumType e) const |
EnumType | lookup (const word &enumName, const EnumType deflt) const |
EnumType | get (const word &key, const dictionary &dict) const |
EnumType | getOrDefault (const word &key, const dictionary &dict, const EnumType deflt, const bool failsafe=false) const |
bool | readEntry (const word &key, const dictionary &dict, EnumType &val, const bool mandatory=true) const |
bool | readIfPresent (const word &key, const dictionary &dict, EnumType &val) const |
EnumType | read (Istream &is) const |
bool | read (Istream &is, EnumType &val, const bool mandatory=true) const |
void | write (const EnumType e, Ostream &os) const |
template<class OS > | |
OS & | writeList (OS &os, const label ununsed=0) const |
EnumType | operator[] (const word &enumName) const |
const word & | operator[] (const EnumType e) const |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
const_iterator | begin () const noexcept |
const_iterator | end () const noexcept |
EnumType | lookupOrDefault (const word &key, const dictionary &dict, const EnumType deflt, const bool failsafe=false) const |
const word & | operator() (const EnumType e) const |
EnumType | operator() (const word &key, const EnumType deflt) const |
EnumType | get (const word &key, const EnumType deflt) const |
EnumType | lookup (const word &key, const dictionary &dict) const |
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values. All dictionary searches use a literal (not regex).
Definition at line 53 of file IOstreamOption.H.
typedef EnumType value_type |
|
defaultnoexcept |
|
explicit |
|
inlinenoexcept |
Definition at line 31 of file EnumI.H.
Referenced by Enum< actionType >::cend().
|
inlinenoexcept |
Definition at line 39 of file EnumI.H.
Referenced by Enum::const_iterator::key().
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Definition at line 63 of file EnumI.H.
Referenced by filmTurbulenceModel::Cw().
void append | ( | std::initializer_list< std::pair< EnumType, const char * >> | list | ) |
Definition at line 96 of file EnumI.H.
Referenced by FIREMeshReader::readGeometry().
EnumType get | ( | const word & | enumName | ) | const |
Definition at line 68 of file Enum.C.
Referenced by filmTurbulenceModel::filmTurbulenceModel(), Enum< actionType >::lookup(), Enum< actionType >::operator()(), Enum< actionType >::operator[](), limitFields::read(), externalHeatFluxSource::read(), and lumpedPointMovement::readDict().
|
inline |
Definition at line 85 of file Enum.C.
Referenced by Enum< actionType >::get(), Foam::getStopAction(), Enum< actionType >::operator()(), and derivedFields::read().
EnumType get | ( | const word & | key, |
const dictionary & | dict | ||
) | const |
EnumType getOrDefault | ( | const word & | key, |
const dictionary & | dict, | ||
const EnumType | deflt, | ||
const bool | failsafe = false |
||
) | const |
key | Lookup key. Uses LITERAL (not REGEX) |
dict | dictionary |
deflt | fallback if not found |
failsafe | Warn only on bad enumeration |
Definition at line 172 of file Enum.C.
Referenced by distributedTriSurfaceMesh::distributedTriSurfaceMesh(), Enum< actionType >::lookupOrDefault(), abort::read(), and writeObjects::read().
bool readEntry | ( | const word & | key, |
const dictionary & | dict, | ||
EnumType & | val, | ||
const bool | mandatory = true |
||
) | const |
|
inline |
key | Lookup key. Uses LITERAL (not REGEX) |
dict | dictionary |
val | the value to read into |
Definition at line 125 of file EnumI.H.
Referenced by Time::readDict().
EnumType read | ( | Istream & | is | ) | const |
Definition at line 102 of file Enum.C.
Referenced by Foam::operator>>(), and addcommsTypeToOpt::readData().
|
inline |
|
inline |
|
inlinenoexcept |
Definition at line 226 of file EnumI.H.
Referenced by Enum< actionType >::begin().
|
inlinenoexcept |
Definition at line 234 of file EnumI.H.
Referenced by Enum< actionType >::end().
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.