39 bool Foam::objectRegistry::parentNotTime()
const 41 return (&parent_ != dynamic_cast<const objectRegistry*>(&time_));
47 Foam::objectRegistry::objectRegistry
50 const label nIoObjects
57 string::validate<word>(t.
caseName()),
74 Foam::objectRegistry::objectRegistry
77 const label nIoObjects
84 dbDir_(parent_.dbDir()/local()/
name()),
98 for (iterator iter = begin(); iter != end(); ++iter)
100 if (iter()->ownedByRegistry())
102 myObjects[nMyObjects++] = iter();
106 for (
label i=0; i < nMyObjects; i++)
108 checkOut(*myObjects[i]);
132 for (const_iterator iter = cbegin(); iter != cend(); ++iter)
136 objectNames[count++] = iter.key();
148 wordList sortedLst = names(ClassName);
158 const bool forceCreate
161 if (forceCreate && !foundObject<objectRegistry>(name))
174 fieldsCachePtr->
store();
176 return lookupObject<objectRegistry>(
name);
182 label curEvent = event_++;
186 if (objectRegistry::debug)
189 <<
"Event counter has overflowed. " 190 <<
"Resetting counter on all dependent objects." <<
nl 191 <<
"This might cause extra evaluations." <<
endl;
198 for (const_iterator iter = begin(); iter != end(); ++iter)
202 if (objectRegistry::debug)
204 Pout<<
"objectRegistry::getEvent() : " 205 <<
"resetting count on " << iter.key() <<
endl;
221 if (objectRegistry::debug)
223 Pout<<
"objectRegistry::checkIn(regIOobject&) : " 224 <<
name() <<
" : checking in " << io.
name()
225 <<
" of type " << io.type()
239 if (objectRegistry::debug)
241 Pout<<
"objectRegistry::checkOut(regIOobject&) : " 242 <<
name() <<
" : checking out " << iter.key()
248 if (objectRegistry::debug)
251 <<
name() <<
" : attempt to checkOut copy of " 274 if (objectRegistry::debug)
276 Pout<<
"objectRegistry::checkOut(regIOobject&) : " 277 <<
name() <<
" : could not find " << io.
name()
278 <<
" in registry " <<
name()
294 if (i == string::npos)
300 dbDir_.
replace(i+1, string::npos, newName);
309 if (iter()->modified())
321 for (iterator iter = begin(); iter != end(); ++iter)
323 if (objectRegistry::debug)
325 Pout<<
"objectRegistry::readModifiedObjects() : " 326 <<
name() <<
" : Considering reading object " 327 << iter.key() <<
endl;
330 iter()->readIfModified();
337 readModifiedObjects();
354 if (objectRegistry::debug)
356 Pout<<
"objectRegistry::write() : " 357 <<
name() <<
" : Considering writing object " 359 <<
" of type " << iter()->type()
360 <<
" with writeOpt " << iter()->writeOpt()
361 <<
" to file " << iter()->objectPath()
365 if (iter()->writeOpt() != NO_WRITE)
367 ok = iter()->writeObject(fmt, ver, cmp, valid) && 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.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid) const
Write the objects.
void readModifiedObjects()
Read the objects that have been modified.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
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 occurence of sub-string oldStr with newStr.
#define WarningInFunction
Report a warning using Foam::Warning.
Constant dispersed-phase particle diameter model.
const Time & time() const
Return time.
prefixOSstream Pout(cout, "Pout")
List< Key > sortedToc() const
Return the table of contents as a sorted list.
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...
bool checkIn()
Add object to registry.
virtual void rename(const word &newName)
Rename.