47#ifndef FoamCompat_NamedEnum_H
48#define FoamCompat_NamedEnum_H
60template<
class EnumType,
int nEnum>
class NamedEnum;
62template<
class EnumType,
int nEnum>
70template<
class EnumType,
int nEnum>
74 static_assert(nEnum > 0,
"nEnum must be positive (non-zero)");
89 void operator=(
const NamedEnum&) =
delete;
95 typedef EnumType value_type;
101 static const char*
names[nEnum];
115 inline label size()
const;
133 inline bool found(
const word& enumName)
const;
136 inline bool hasEnum(
const word& enumName)
const;
139 bool hasName(
const EnumType
e)
const;
157 EnumType lookupOrDefault
178 inline const EnumType operator[](
const word&
name)
const;
181 inline const char* operator[](
const EnumType
e)
const;
187 friend Ostream& operator<< <EnumType, nEnum>
203#include "NamedEnum.txx"
A HashTable similar to std::unordered_map.
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...
A NamedEnum is a wrapper around a list of names that represent particular enumeration values.
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)
List< word > wordList
List of word.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum