39 bool Foam::objectRegistry::parentNotTime()
const 41 return (&parent_ != dynamic_cast<const objectRegistry*>(&time_));
50 const label nIoObjects
57 string::validate<word>(t.
caseName()),
77 const label nIoObjects
84 dbDir_(parent_.dbDir()/local()/
name()),
118 for (const_iterator iter = cbegin(); iter != cend(); ++iter)
122 objectNames[count++] = iter.key();
134 wordList sortedLst = names(ClassName);
144 const bool forceCreate
147 if (forceCreate && !foundObject<objectRegistry>(name))
160 fieldsCachePtr->
store();
162 return lookupObject<objectRegistry>(
name);
168 label curEvent = event_++;
172 if (objectRegistry::debug)
175 <<
"Event counter has overflowed. " 176 <<
"Resetting counter on all dependent objects." <<
nl 177 <<
"This might cause extra evaluations." <<
endl;
184 for (const_iterator iter = begin(); iter != end(); ++iter)
188 if (objectRegistry::debug)
190 Pout<<
"objectRegistry::getEvent() : " 191 <<
"resetting count on " << iter.key() <<
endl;
207 if (objectRegistry::debug)
209 Pout<<
"objectRegistry::checkIn(regIOobject&) : " 210 <<
name() <<
" : checking in " << io.
name()
211 <<
" of type " << io.type()
225 if (objectRegistry::debug)
227 Pout<<
"objectRegistry::checkOut(regIOobject&) : " 228 <<
name() <<
" : checking out " << iter.key()
234 if (objectRegistry::debug)
237 <<
name() <<
" : attempt to checkOut copy of " 260 if (objectRegistry::debug)
262 Pout<<
"objectRegistry::checkOut(regIOobject&) : " 263 <<
name() <<
" : could not find " << io.
name()
264 <<
" in registry " <<
name()
276 label nMyObjects = 0;
278 for (iterator iter = begin(); iter != end(); ++iter)
280 if (iter()->ownedByRegistry())
282 myObjects[nMyObjects++] = iter();
286 for (
label i=0; i < nMyObjects; i++)
288 checkOut(*myObjects[i]);
300 if (i == string::npos)
306 dbDir_.
replace(i+1, string::npos, newName);
315 if (iter()->modified())
327 for (iterator iter = begin(); iter != end(); ++iter)
329 if (objectRegistry::debug)
331 Pout<<
"objectRegistry::readModifiedObjects() : " 332 <<
name() <<
" : Considering reading object " 333 << iter.key() <<
endl;
336 iter()->readIfModified();
343 readModifiedObjects();
360 if (objectRegistry::debug)
362 Pout<<
"objectRegistry::write() : " 363 <<
name() <<
" : Considering writing object " 365 <<
" of type " << iter()->type()
366 <<
" with writeOpt " << iter()->writeOpt()
367 <<
" to file " << iter()->objectPath()
371 if (iter()->writeOpt() != NO_WRITE)
373 ok = iter()->writeObject(fmt, ver, cmp, write) && ok;
fileName path() const
Return path.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
void readModifiedObjects()
Read the objects that have been modified.
wordList names() const
Return the list of names of the IOobjects.
virtual bool modified() const
Return true if any of the object's files have been modified.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool ownedByRegistry() const
Is this object owned by the registry?
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
objectRegistry(const Time &db, const label nIoObjects=128)
Construct the time objectRegistry given an initial estimate.
A class for handling words, derived from string.
const fileName & caseName() const
Return case name.
wordList sortedNames() const
Return the sorted list of names of the IOobjects.
virtual ~objectRegistry()
Destructor.
label getEvent() const
Return new event number.
streamFormat
Enumeration for the format of data in the stream.
label eventNo() const
Event number at last update.
static const label labelMax
virtual bool readIfModified()
Read object if modified.
An STL-conforming hash table.
graph_traits< Graph >::vertices_size_type size_type
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
compressionType
Enumeration for the format of data in the stream.
void store()
Transfer ownership of this object to its registry.
bool checkOut()
Remove object from registry.
defineTypeNameAndDebug(combustionModel, 0)
virtual void rename(const word &newName)
Rename.
word name(const complex &)
Return a string representation of a complex.
void setSize(const label)
Reset size of List.
string & replace(const string &oldStr, const string &newStr, size_type start=0)
Replace first occurrence of sub-string oldStr with newStr.
#define WarningInFunction
Report a warning using Foam::Warning.
const Time & time() const
Return time.
prefixOSstream Pout(cout, "Pout")
List< Key > sortedToc() const
Return the table of contents as a sorted list.
void clear()
Remove all regIOobject owned by the registry.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false) const
Lookup and return a const sub-objectRegistry. Optionally create.
List< Key > toc() const
Return the table of contents.
Registry of regIOobjects.
const objectRegistry & db() const
Return the local objectRegistry.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write) const
Write the objects.
bool checkIn()
Add object to registry.
virtual void rename(const word &newName)
Rename.