34 void Foam::objectRegistry::readCacheTemporaryObjects()
const 36 if (cacheTemporaryObjectsActive_)
return;
40 "cacheTemporaryObjects",
46 cacheTemporaryObjectsActive_ =
true;
56 eptr->dict().readIfPresent(
name(), objectNames);
61 eptr->readEntry(objectNames);
64 for (
const word& objName : objectNames)
66 cacheTemporaryObjects_.emplace(objName,
false,
false);
71 Info<<
"objectRegistry::cacheTemporaryObjects : " 78 void Foam::objectRegistry::deleteCachedObject(regIOobject*
io)
const 106 return cacheTemporaryObjects_.contains(
name);
112 return io && cacheTemporaryObjects_.contains(
io->
name());
118 return cacheTemporaryObjects_.contains(
io.
name());
127 if (
io && !cacheTemporaryObjects_.empty())
129 auto iter = cacheTemporaryObjects_.find(
io->
name());
134 iter.val().first() =
false;
145 resetCacheTemporaryObject(&
io);
151 bool enabled = cacheTemporaryObjects_.size();
155 const auto* subObr =
dynamic_cast<const objectRegistry*
>(iter.val());
158 if (subObr && subObr !=
this)
166 OSstream* emitWarning =
nullptr;
170 if (!iter.val().second())
177 <<
"objectRegistry '" 178 <<
name() <<
"' has missing temporary objects:" <<
nl;
181 *emitWarning<<
" " << iter.key() <<
nl;
185 iter.val().second() =
false;
192 <<
"Available temporary objects: " 193 << temporaryObjects_.sortedToc() <<
endl;
196 temporaryObjects_.clear();
const word & name() const noexcept
Return the object name.
constexpr char nl
The newline '\n' character (0x0a)
virtual void rename(const word &newName)
Rename the object.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool is_cacheTemporaryObject(const word &name) const
True if given name is in the cacheTemporaryObjects set.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
const dictionary & controlDict() const noexcept
Return read access to the controlDict dictionary.
bool checkCacheTemporaryObjects() const
Check that all objects specified in the cacheTemporaryObjects were also cached.
OSstream & stream(OSstream *alternative=nullptr)
Return OSstream for output operations.
void resetCacheTemporaryObject(const regIOobject *io) const
Reset the cache state of the given object (nullptr is ignored)
int debug
Static debugging option.
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text...
List< word > wordList
List of word.
const entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
messageStream Info
Information stream (stdout output on master, null elsewhere)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Registry of regIOobjects.
forAllConstIters(mixture.phases(), phase)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.