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());
103void 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);
266 Table& tbl = getOrCreateScope(scope);
270 tbl.
set(
name, std::move(value));
285 word scopeName(scope);
289 if (scopeName.empty())
323 auto iter = variables_.find(scope);
325 return (iter.found() && (*iter).erase(
name));
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
bool set(const word &key, exprResult *ptr)
Assign a new entry, overwriting existing entries.
const_iterator cbegin() const
const_iterator set to the beginning of the HashTable
bool found(const Key &key) const
Return true if hashed entry is found in table.
iterator find(const Key &key)
Find and return an iterator set at the hashed entry.
constexpr const_iterator cend() const noexcept
const_iterator to signal the end (for any HashTable)
const word & name() const noexcept
Return the object name.
streamFormat format() const noexcept
Get the current stream format.
bool good() const noexcept
True if next operation might succeed.
bool bad() const noexcept
True if stream is corrupted.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
unsigned int get() const
Get value as unsigned, no range-checking.
label timeIndex() const noexcept
Return current time index.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Table()=default
Default construct.
A globally available registry of expression results. These are currently registered on Time (may chan...
virtual bool writeData(Ostream &os) const
Write variables.
exprResult & addValue(const word &name, const word &scope, const exprResult &value, const bool overwrite=true)
Add named result to specified scope.
virtual bool readData(Istream &os)
Read variables.
Table & getNamespace(const word &name)
Get an existing table for the namespace.
static bool Delete(const objectRegistry &obr)
Static destructor for singleton.
bool removeValue(const word &name, const word &scope)
Remove named result from specified scope.
A polymorphic field/result from evaluating an expression.
static const exprResult null
An empty result.
Registry of regIOobjects.
const Time & time() const noexcept
Return time registry.
bool checkOut(regIOobject *io) const
Type * getObjectPtr(const word &name, const bool recursive=false) const
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
constexpr char nl
The newline '\n' character (0x0a)
#define forAllIters(container, iter)
Iterate across all elements in the container object.
static const char *const typeName
The type name used in ensight case files.