31 template<
class Enum,
unsigned int nEnum>
39 table_.
insert(names[ei], ei);
44 template<
class Enum,
unsigned int nEnum>
53 template<
class Enum,
unsigned int nEnum>
63 <<
name <<
" is not in enumeration: "
71 template<
class Enum,
unsigned int nEnum>
76 const Enum defaultValue
85 template<
class Enum,
unsigned int nEnum>
90 Enum selection = Enum(0);
91 unsigned int nSelections = 0;
101 if (nSelections == 0)
104 <<
"None of the options selected, please specify one of: "
107 else if (nSelections > 1)
110 <<
"More than one option selected, please specify one of: "
118 template<
class Enum,
unsigned int nEnum>
#define forAll(list, i)
Loop across all elements in list.
An STL-conforming hash table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Initialise the NamedEnum HashTable from the static list of names.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
Enum select(const dictionary &dict) const
Select the name from the dictionary and return the.
Enum lookupOrDefault(const word &name, const dictionary &dict, const Enum defaultValue) const
Lookup the name from the dictionary if present and return the.
NamedEnum(const FixedList< word, nEnum > &names)
Construct from list of names.
void write(const Enum e, Ostream &) const
Write the name representation of the enumeration to an Ostream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool read(const char *, int32_t &)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.