32 template<
class Enum,
unsigned int nEnum>
40 table_.
insert(names[ei], ei);
45 template<
class Enum,
unsigned int nEnum>
54 template<
class Enum,
unsigned int nEnum>
64 <<
name <<
" is not in enumeration: "
72 template<
class Enum,
unsigned int nEnum>
77 const Enum defaultValue
95 template<
class Enum,
unsigned int nEnum>
100 Enum selection = Enum(0);
101 unsigned int nSelections = 0;
106 selection = Enum(ei);
111 if (nSelections == 0)
114 <<
"None of the options selected, please specify one of: "
117 else if (nSelections > 1)
120 <<
"More than one option selected, please specify one of: "
128 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 add(entry *, bool mergeEntry=false)
Add a new entry.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
static bool haveDefaults(const dictionary &dict)
Return if a dictionary exists to add defaults to for a given.
static dictionary & defaults(const dictionary &dict)
Return the dictionary to add defaults to for a given dictionary.
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)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.