41 const bool acceptPrimitiveEntry,
42 const bool report =
false
59 const keyType& kw = dEntry.keyword();
67 else if (dEntry.isDict())
77 ok = acceptPrimitiveEntry;
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);
206void Foam::expressions::exprDriver::resetFunctions
208 const dictionary&
dict
223 writeFuncsImpl<scalar>(
os,
"functions<scalar>", dict_, scalarFuncs_);
224 writeFuncsImpl<vector>(
os,
"functions<vector>", dict_, vectorFuncs_);
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A HashTable similar to std::unordered_map.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
void resize(const label sz)
Resize the hash table for efficiency.
label size() const noexcept
The number of elements in table.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & endBlock()
Write end block group.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
A keyword and a list of tokens is an 'entry'.
void writeFunctions(Ostream &os) const
Write scalar/vector Function1 entries in dictionary format.
HashTable< refPtr< Function1< scalar > > > scalarFuncs_
HashTable< refPtr< Function1< vector > > > vectorFuncs_
const objectRegistry * obrPtr_
Pointer to an object registry (for functions etc).
const dictionary & dict_
The dictionary with all input data/specification.
A class for handling keywords in dictionaries.
bool isPattern() const noexcept
The keyType is treated as a pattern, not as literal string.
Registry of regIOobjects.
A class for managing references or pointers (no reference counting)
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define InfoInFunction
Report an information message using Foam::Info.
void func(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static wordHashSet getAcceptableFunctionKeys(const dictionary *dictPtr, const bool acceptPrimitiveEntry, const bool report=false)
static void resetFuncsImpl(const word &subDictName, const dictionary &topDict, HashTable< refPtr< Function1< Type > > > &tbl, const objectRegistry *obrPtr)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static void writeFuncsImpl(Ostream &os, const word &subDictName, const dictionary &topDict, const HashTable< refPtr< Function1< Type > > > &tbl)
constexpr char nl
The newline '\n' character (0x0a)