Go to the documentation of this file.
41 const bool acceptPrimitiveEntry,
42 const bool report =
false
54 acceptKeys.resize(2*
dict.size());
59 const keyType& kw = dEntry.keyword();
67 else if (dEntry.isDict())
77 ok = acceptPrimitiveEntry;
86 rejectKeys.insert(kw);
90 if (report && rejectKeys.size())
93 <<
"Dropped invalid/redundant entries: "
106 const word& subDictName,
133 for (
const word& entryName : acceptKeys)
143 tbl.insert(entryName, std::move(
func));
154 const word& subDictName,
162 if (!dictPtr || tbl.empty())
173 const word& entryName = dEntry.keyword();
175 const auto iter = tbl.cfind(entryName);
182 const auto& funcPtr = iter.val();
191 (*funcPtr).writeData(
os);
206 void Foam::expressions::exprDriver::resetFunctions
208 const dictionary&
dict
223 writeFuncsImpl<scalar>(
os,
"functions<scalar>", dict_, scalarFuncs_);
224 writeFuncsImpl<vector>(
os,
"functions<vector>", dict_, vectorFuncs_);
int debug
Static debugging option.
A keyword and a list of tokens is an 'entry'.
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
#define InfoInFunction
Report an information message using Foam::Info.
A class for handling words, derived from Foam::string.
bool isPattern() const noexcept
The keyType is treated as a pattern, not as literal string.
HashTable< refPtr< Function1< vector > > > vectorFuncs_
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
const dictionary & dict_
The dictionary with all input data/specification.
A HashTable with keys but without contents that is similar to std::unordered_set.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Registry of regIOobjects.
A class for handling keywords in dictionaries.
static void writeFuncsImpl(Ostream &os, const word &subDictName, const dictionary &topDict, const HashTable< refPtr< Function1< Type >>> &tbl)
void writeFunctions(Ostream &os) const
Write scalar/vector Function1 entries in dictionary format.
void func(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual Ostream & endBlock()
Write end block group.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static wordHashSet getAcceptableFunctionKeys(const dictionary *dictPtr, const bool acceptPrimitiveEntry, const bool report=false)
A HashTable similar to std::unordered_map.
HashTable< refPtr< Function1< scalar > > > scalarFuncs_
const objectRegistry * obrPtr_
Pointer to an object registry (for functions etc).
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static void resetFuncsImpl(const word &subDictName, const dictionary &topDict, HashTable< refPtr< Function1< Type >>> &tbl, const objectRegistry *obrPtr)
A class for managing references or pointers (no reference counting)