|
| | Enum ()=default |
| | Construct null (empty list) More...
|
| |
| | Enum (std::initializer_list< std::pair< EnumType, const char * >> list) |
| | Construct from a values/names list. More...
|
| |
| bool | empty () const noexcept |
| | True if the enumeration list is empty. More...
|
| |
| label | size () const noexcept |
| | The number of name/value pairs for the enumeration. More...
|
| |
| const List< word > & | names () const |
| | The list of enum names, in construction order. Same as toc() More...
|
| |
| const List< word > & | toc () const |
| | The list of enum names, in construction order. Same as names() More...
|
| |
| List< word > | sortedToc () const |
| | The sorted list of enum names. More...
|
| |
| const List< int > & | values () const |
| | The list of enum values, in construction order. More...
|
| |
| void | clear () |
| | Clear all entries. More...
|
| |
| void | append (std::initializer_list< std::pair< EnumType, const char * >> list) |
| | Append value/key pairs to the lists of known enumerations. More...
|
| |
| label | find (const word &enumName) const |
| | Find the index of the given name. More...
|
| |
| label | find (const EnumType e) const |
| | Find the first index of given enumeration. More...
|
| |
| bool | found (const word &enumName) const |
| | Test if there is an enumeration corresponding to the given name. More...
|
| |
| bool | found (const EnumType e) const |
| | Test if there is a name corresponding to the given enumeration. More...
|
| |
| EnumType | get (const word &enumName) const |
| | The enumeration corresponding to the given name. More...
|
| |
| EnumType | get (const word &enumName, const EnumType deflt) const |
| | The enumeration corresponding to the given name. More...
|
| |
| const word & | get (const EnumType e) const |
| | The name corresponding to the given enumeration. More...
|
| |
| 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 |
| | Find entry and assign to T val. More...
|
| |
| bool | readIfPresent (const word &key, const dictionary &dict, EnumType &val) const |
| | Find an entry if present, and assign to T val. More...
|
| |
| EnumType | read (Istream &is) const |
| | Read a word from Istream and return the corresponding enumeration. More...
|
| |
| bool | read (Istream &is, EnumType &val, const bool mandatory=true) const |
| | Read a word from Istream, lookup named enumeration. More...
|
| |
| void | write (const EnumType e, Ostream &os) const |
| | Write the name representation of the enumeration to an Ostream. More...
|
| |
| Ostream & | writeList (Ostream &os, const label shortLen=0) const |
| | Write the names as a list to an Ostream. More...
|
| |
| EnumType | operator[] (const word &enumName) const |
| | Return the enumeration corresponding to the given name. More...
|
| |
| const word & | operator[] (const EnumType e) const |
| |
| const word & | operator() (const EnumType e) const |
| |
| EnumType | operator() (const word &enumName, const EnumType deflt) const |
| |
| EnumType | lookupOrDefault (const word &key, const dictionary &dict, const EnumType deflt, const bool failsafe=false) const |
| |
| EnumType | lookup (const word &key, const dictionary &dict) const |
| | Deprecated(2018-10) same as two-parameter get() More...
|
| |
template<class EnumType>
class Foam::Enum< EnumType >
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).
- Source files
-
Definition at line 57 of file IOstreamOption.H.