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,
109 HashTable<refPtr<Function1<Type>>>& tbl,
110 const objectRegistry* obrPtr
134 for (
const word& entryName : acceptKeys)
139 Function1<Type>::New(entryName,
dict, obrPtr)
144 tbl.insert(entryName, std::move(func));
155 const word& subDictName,
163 if (!dictPtr || tbl.empty())
174 const word& entryName = dEntry.keyword();
176 const auto iter = tbl.cfind(entryName);
183 const auto& funcPtr = iter.val();
192 (*funcPtr).writeData(
os);
207void Foam::expressions::exprDriver::resetFunctions
bool empty() const noexcept
True if the list is empty.
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 reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
label size() const noexcept
The number of elements in table.
void clear()
Remove all entries from 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,...
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...
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_
Function1 mappings/timelines (scalar), evaluated at the simulation time or with arbitrary scalars.
HashTable< refPtr< Function1< vector > > > vectorFuncs_
Function1 mappings/timelines (vector), evaluated at the simulation time or with arbitrary scalars.
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.
Namespace for handling debugging switches.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
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).