Go to the documentation of this file.
47 Foam::expressions::exprResultGlobals::exprResultGlobals
49 const objectRegistry& obr
56 exprResultGlobals::typeName,
60 IOobject::READ_IF_PRESENT,
82 for (
auto iter = tbl.cbegin(); iter != tbl.cend(); ++iter)
84 this->
set(iter.key(), (*iter)->clone());
103 void Foam::expressions::exprResultGlobals::reset()
192 return variables_[
name];
203 for (
const word& scopeName : scopes)
205 const auto tableIter = variables_.cfind(scopeName);
207 if (tableIter.found())
209 const auto resultIter = (*tableIter).cfind(
name);
211 if (resultIter.found())
213 return *(*resultIter);
220 <<
"No scope " << scopeName <<
" for " <<
name <<
nl
221 <<
"Known global scopes: " << variables_.sortedToc() <<
nl;
239 Table& tbl = getOrCreateScope(scope);
241 auto iter = tbl.find(
name);
246 iter = tbl.find(
name);
266 Table& tbl = getOrCreateScope(scope);
268 if (overwrite || !tbl.found(
name))
270 tbl.set(
name, std::move(value));
285 word scopeName(scope);
289 if (scopeName.empty())
291 scopeName =
dict.get<
word>(
"globalScope");
294 if (
dict.found(
"resultType"))
310 exprResult(
dict,
true),
323 auto iter = variables_.find(scope);
325 return (iter.found() && (*iter).erase(
name));
Type * getObjectPtr(const word &name, const bool recursive=false) const
virtual bool writeData(Ostream &os) const
A class for handling words, derived from Foam::string.
defineTypeName(fvExprDriverWriter)
streamFormat format() const noexcept
const exprResult & get(const word &name, const wordUList &scopes) const
Table & getNamespace(const word &name)
Registry of regIOobjects.
static const exprResult null
label timeIndex() const noexcept
bool set(const Key &key, T *ptr)
A polymorphic field/result from evaluating an expression.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static autoPtr< exprResult > New(const dictionary &dict)
A globally available registry of expression results. These are currently registered on Time (may chan...
#define forAllIters(container, iter)
virtual bool readData(Istream &os)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool removeValue(const word &name, const word &scope)
OBJstream os(runTime.globalPath()/outputName)
bool bad() const noexcept
static bool Delete(const objectRegistry &obr)
const word & name() const noexcept
exprResult & addValue(const word &name, const word &scope, const exprResult &value, const bool overwrite=true)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
@ ASCII
"ascii" (normal default)
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool checkOut(regIOobject *io) const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Istream & readStream(const word &, const bool valid=true)
static exprResultGlobals & New(const objectRegistry &obr)
#define WarningInFunction
const Time & time() const noexcept