41 const bool acceptPrimitiveEntry,
42 const bool report =
false 60 const keyType& kw = dEntry.keyword();
68 else if (dEntry.isDict())
78 ok = acceptPrimitiveEntry;
91 if (report && rejectKeys.
size())
94 <<
"Dropped invalid/redundant entries: " 107 const word& subDictName,
108 const dictionary& topDict,
109 HashTable<refPtr<Function1<Type>>>& tbl,
110 const objectRegistry* obrPtr
134 for (
const word& entryName : acceptKeys)
137 refPtr<Function1<Type>> func
139 Function1<Type>::New(entryName,
dict, obrPtr)
144 tbl.insert(entryName, std::move(func));
155 const word& subDictName,
156 const dictionary& topDict,
157 const HashTable<refPtr<Function1<Type>>>& tbl
163 if (!dictPtr || tbl.empty())
172 for (
const entry& dEntry :
dict)
174 const word& entryName = dEntry.keyword();
176 const auto iter = tbl.cfind(entryName);
183 const auto& funcPtr = iter.val();
192 (*funcPtr).writeData(
os);
207 void Foam::expressions::exprDriver::resetFunctions
209 const dictionary&
dict 224 writeFuncsImpl<scalar>(
os,
"functions<scalar>", dict_, scalarFuncs_);
225 writeFuncsImpl<vector>(
os,
"functions<vector>", dict_, vectorFuncs_);
A class for handling keywords in dictionaries.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
static void writeFuncsImpl(Ostream &os, const word &subDictName, const dictionary &topDict, const HashTable< refPtr< Function1< Type >>> &tbl)
static wordHashSet getAcceptableFunctionKeys(const dictionary *dictPtr, const bool acceptPrimitiveEntry, const bool report=false)
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
static void resetFuncsImpl(const word &subDictName, const dictionary &topDict, HashTable< refPtr< Function1< Type >>> &tbl, const objectRegistry *obrPtr)
virtual Ostream & endBlock()
Write end block group.
bool isPattern() const noexcept
The keyType is treated as a pattern, not as literal string.
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...
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
HashTable< refPtr< Function1< vector > > > vectorFuncs_
Function1 mappings/timelines (vector), evaluated at the simulation time or with arbitrary scalars...
void writeFunctions(Ostream &os) const
Write scalar/vector Function1 entries in dictionary format.
const dictionary & dict_
The dictionary with all input data/specification.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
const objectRegistry * obrPtr_
Pointer to an object registry (for functions etc).
HashTable< refPtr< Function1< scalar > > > scalarFuncs_
Function1 mappings/timelines (scalar), evaluated at the simulation time or with arbitrary scalars...
A keyword and a list of tokens is an 'entry'.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
#define InfoInFunction
Report an information message using Foam::Info.