Go to the documentation of this file.
50 const label nIoObjects
57 string::validate<word>(t.
caseName()),
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();
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;
209 if (objectRegistry::debug)
211 Pout<<
"objectRegistry::checkIn(regIOobject&) : "
212 <<
name() <<
" : checking in " << io.
name()
213 <<
" of type " << io.type()
227 if (objectRegistry::debug)
229 Pout<<
"objectRegistry::checkOut(regIOobject&) : "
230 <<
name() <<
" : checking out " << iter.key()
236 if (objectRegistry::debug)
239 <<
name() <<
" : attempt to checkOut copy of "
262 if (objectRegistry::debug)
264 Pout<<
"objectRegistry::checkOut(regIOobject&) : "
265 <<
name() <<
" : could not find " << io.
name()
266 <<
" in registry " <<
name()
282 if (i == string::npos)
288 dbDir_.
replace(i+1, string::npos, newName);
297 if (iter()->modified())
309 for (iterator iter = begin(); iter != end(); ++iter)
311 if (objectRegistry::debug)
313 Pout<<
"objectRegistry::readModifiedObjects() : "
314 <<
name() <<
" : Considering reading object "
315 << iter.key() <<
endl;
318 iter()->readIfModified();
325 readModifiedObjects();
341 if (objectRegistry::debug)
343 Pout<<
"objectRegistry::write() : "
344 <<
name() <<
" : Considering writing object "
346 <<
" of type " << iter()->type()
347 <<
" with writeOpt " << iter()->writeOpt()
348 <<
" to file " << iter()->objectPath()
352 if (iter()->writeOpt() != NO_WRITE)
354 ok = iter()->writeObject(fmt, ver, cmp) && ok;
virtual bool readIfModified()
Read object if modified.
wordList sortedNames() const
Return the sorted list of names of the IOobjects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual ~objectRegistry()
Destructor.
label getEvent() const
Return new event number.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from string.
List< Key > toc() const
Return the table of contents.
const fileName & caseName() const
Return case name.
compressionType
Enumeration for the format of data in the stream.
static const label labelMax
bool checkIn()
Add object to registry.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const objectRegistry & parent_
Parent objectRegistry.
const Time & time() const
Return time.
bool parentNotTime() const
Is the objectRegistry parent_ different from time_.
Constant dispersed-phase particle diameter model.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const objectRegistry & db() const
Return the local objectRegistry.
Registry of regIOobjects.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false) const
Lookup and return a const sub-objectRegistry. Optionally create.
objectRegistry(const objectRegistry &)
Disallow Copy constructor.
virtual void rename(const word &newName)
Rename.
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 Time & time_
Master time objectRegistry.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
const word & name() const
Return name.
graph_traits< Graph >::vertices_size_type size_type
bool ownedByRegistry() const
Is this object owned by the registry?
List< Key > sortedToc() const
Return the table of contents as a sorted list.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
virtual bool modified() const
Return true if any of the object's files have been modified.
void readModifiedObjects()
Read the objects that have been modified.
void setSize(const label)
Reset size of List.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void store()
Transfer ownership of this object to its registry.
string & replace(const string &oldStr, const string &newStr, size_type start=0)
Replace first occurence of sub-string oldStr with newStr.
bool checkOut()
Remove object from registry.
prefixOSstream Pout(cout, "Pout")
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
wordList names() const
Return the list of names of the IOobjects.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write the objects.
virtual void rename(const word &newName)
Rename.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
streamFormat
Enumeration for the format of data in the stream.