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();
353 if (objectRegistry::debug)
355 Pout<<
"objectRegistry::write() : " 356 <<
name() <<
" : Considering writing object " 358 <<
" of type " << iter()->type()
359 <<
" with writeOpt " << iter()->writeOpt()
360 <<
" to file " << iter()->objectPath()
364 if (iter()->writeOpt() != NO_WRITE)
366 ok = iter()->writeObject(fmt, ver, cmp) && ok;
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 objectRegistry & db() const
Return the local objectRegistry.
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...
Ostream & endl(Ostream &os)
Add newline and flush stream.
label eventNo() const
Event number at last update.
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.
bool ownedByRegistry() const
Is this object owned by the registry?
virtual bool modified() const
Return true if any of the object's files have been modified.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false) const
Lookup and return a const sub-objectRegistry. Optionally create.
A class for handling words, derived from string.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write the objects.
const Time & time() const
Return time.
virtual ~objectRegistry()
Destructor.
streamFormat
Enumeration for the format of data in the stream.
static const label labelMax
virtual bool readIfModified()
Read object if modified.
wordList names() const
Return the list of names of the IOobjects.
graph_traits< Graph >::vertices_size_type size_type
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
List< Key > toc() const
Return the table of contents.
compressionType
Enumeration for the format of data in the stream.
void store()
Transfer ownership of this object to its registry.
prefixOSstream Pout(cout,"Pout")
bool checkOut()
Remove object from registry.
label getEvent() const
Return new event number.
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.
wordList sortedNames() const
Return the sorted list of names of the IOobjects.
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.
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...
Registry of regIOobjects.
fileName path() const
Return path.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
bool checkIn()
Add object to registry.
const word & name() const
Return name.
virtual void rename(const word &newName)
Rename.
const fileName & caseName() const
Return case name.