30 template<
class Enum,
int nEnum>
35 for (
int enumI = 0; enumI < nEnum; ++enumI)
41 for (
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,
int nEnum>
71 "NamedEnum<Enum, nEnum>::read(Istream&) const", is
72 ) << name <<
" is not in enumeration: " 80 template<
class Enum,
int nEnum>
87 template<
class Enum,
int nEnum>
93 for (
int enumI = 0; enumI < nEnum; ++enumI)
97 lst[nElem++] =
names[enumI];
106 template<
class Enum,
int nEnum>
112 for (
int enumI = 0; enumI < nEnum; ++enumI)
116 lst[nElem++] =
names[enumI];
word name(const complex &)
Return a string representation of a complex.
const Enum operator[](const char *name) const
Return the enumeration element corresponding to the given name.
bool insert(const word &, const int &newElmt)
Insert a new hashedEntry.
List< word > sortedToc() const
Return the table of contents as a sorted list.
An STL-conforming hash table.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static stringList strings()
The set of names as a list of strings.
const double e
Elementary charge.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static wordList words()
The set of names as a list of words.
NamedEnum()
Construct from names.
errorManip< error > abort(error &err)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
iterator find(const word &)
Find and return an iterator set at the hashedEntry.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
void write(const Enum e, Ostream &) const
Write the name representation of the enumeration to an Ostream.