54template<
class EnumType>
class Enum;
60template<
class EnumType>
75 std::is_enum<EnumType>::value || std::is_integral<EnumType>::value,
76 "Enum must be enum or an integral type"
100 std::initializer_list<std::pair<EnumType, const
char*>> list
136 std::initializer_list<std::pair<EnumType, const
char*>> list
144 inline label
find(const
word& enumName) const;
148 inline label
find(const EnumType
e) const;
151 inline
bool found(const
word& enumName) const;
154 inline
bool found(const EnumType
e) const;
158 EnumType
get(const
word& enumName) const;
162 inline const
word&
get(const EnumType
e) const;
167 EnumType
lookup(const
word& enumName, const EnumType deflt) const;
191 const EnumType deflt,
192 const
bool failsafe = false
205 const
bool mandatory = true
232 const
bool mandatory = true
242 inline OS&
writeList(OS&
os, const label ununsed=0) const;
250 inline EnumType operator[](const
word& enumName) const;
255 inline const
word& operator[](const EnumType
e) const;
275 const Enum* eptr =
nullptr,
280 inline const word& key()
const;
283 inline EnumType val()
const;
315 const EnumType deflt,
316 const bool failsafe =
false
326 const
word& operator()(const EnumType
e)
const
334 EnumType operator()(const
word& key, const EnumType deflt)
const
336 return lookup(key, deflt);
342 EnumType
get(const
word& key, const EnumType deflt)
const
344 return lookup(key, deflt);
360template<
class EnumType>
364template<
class EnumType>
A const_iterator for iterating an Enum list.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const_iterator cbegin() const noexcept
const_iterator begin() const noexcept
const List< int > & values() const noexcept
The list of enum values, in construction order.
label find(const word &enumName) const
Find the index of the given name.
bool empty() const noexcept
True if the enumeration list is empty.
EnumType lookupOrDefault(const word &key, const dictionary &dict, const EnumType deflt, const bool failsafe=false) const
OS & writeList(OS &os, const label ununsed=0) const
const_iterator end() const noexcept
Enum() noexcept=default
Default construct, an empty list.
EnumType value_type
The type of enumeration represented by the Enum.
const_iterator cend() const noexcept
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val) const
Find an entry if present, and assign to T val.
const List< word > & names() const noexcept
The list of enum names, in construction order. Same as toc()
label size() const noexcept
The number of name/value pairs for the enumeration.
const List< word > & toc() const noexcept
The list of enum names, in construction order. Same as names()
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.
List< word > sortedToc() const
The sorted list of enum names.
EnumType read(Istream &is) const
Read a word from Istream and return the corresponding enumeration.
void clear()
Clear all entries.
word key_type
The type of keys used.
EnumType get(const word &enumName) const
The enumeration corresponding to the given name.
void append(std::initializer_list< std::pair< EnumType, const char * > > list)
Append value/key pairs to the lists of known enumerations.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Lookup type of boundary radiation properties.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
bool operator!=(const eddy &a, const eddy &b)
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
#define FOAM_DEPRECATED_FOR(since, replacement)