30 template<
class Enum,
unsigned int nEnum>
35 for (
unsigned int enumI = 0; enumI < nEnum; ++enumI)
41 for (
unsigned int i = 0; i < enumI; ++i)
43 goodNames[i] =
names[i];
47 <<
"Illegal enumeration name at position " << enumI <<
endl
48 <<
"after entries " << goodNames <<
".\n"
49 <<
"Possibly your NamedEnum<Enum, nEnum>::names array"
50 <<
" is not of size " << nEnum <<
endl
60 template<
class Enum,
unsigned int nEnum>
70 <<
name <<
" is not in enumeration: "
78 template<
class Enum,
unsigned int nEnum>
85 template<
class Enum,
unsigned int nEnum>
91 for (
unsigned int enumI = 0; enumI < nEnum; ++enumI)
93 if (names[enumI] && names[enumI][0])
95 lst[nElem++] = names[enumI];
104 template<
class Enum,
unsigned int nEnum>
110 for (
unsigned int enumI = 0; enumI < nEnum; ++enumI)
112 if (names[enumI] && names[enumI][0])
114 lst[nElem++] = names[enumI];
123 template<
class Enum,
unsigned int nEnum>
126 unsigned int ue = unsigned(
e);
135 <<
"names array index " << ue <<
" out of range 0-"
An STL-conforming hash table.
bool insert(const word &, const unsigned int &newElmt)
Insert a new hashedEntry.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void setSize(const label)
Reset size of List.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
NamedEnum()
Construct from names.
static wordList words()
The set of names as a list of words.
static const char * names[nEnum]
The set of names corresponding to the enumeration Enum.
static stringList strings()
The set of names as a list of strings.
const Enum operator[](const char *name) const
Return the enumeration element corresponding to the given name.
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 class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)