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)
188 WarningIn(
"objectRegistry::getEvent() const")
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()
238 if (objectRegistry::debug)
240 Pout<<
"objectRegistry::checkOut(regIOobject&) : " 241 <<
name() <<
" : checking out " << iter.key()
247 if (objectRegistry::debug)
249 WarningIn(
"objectRegistry::checkOut(regIOobject&)")
250 <<
name() <<
" : attempt to checkOut copy of " 273 if (objectRegistry::debug)
275 Pout<<
"objectRegistry::checkOut(regIOobject&) : " 276 <<
name() <<
" : could not find " << io.
name()
277 <<
" in registry " <<
name()
293 if (i == string::npos)
299 dbDir_.
replace(i+1, string::npos, newName);
308 if (iter()->modified())
320 for (iterator iter = begin(); iter != end(); ++iter)
322 if (objectRegistry::debug)
324 Pout<<
"objectRegistry::readModifiedObjects() : " 325 <<
name() <<
" : Considering reading object " 326 << iter.key() <<
endl;
329 iter()->readIfModified();
336 readModifiedObjects();
352 if (objectRegistry::debug)
354 Pout<<
"objectRegistry::write() : " 355 <<
name() <<
" : Considering writing object " 357 <<
" with writeOpt " << iter()->writeOpt()
358 <<
" to file " << iter()->objectPath()
362 if (iter()->writeOpt() != NO_WRITE)
364 ok = iter()->writeObject(fmt, ver, cmp) && ok;
label eventNo() const
Event number at last update.
virtual ~objectRegistry()
Destructor.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write the objects.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
label getEvent() const
Return new event number.
word name(const complex &)
Return a string representation of a complex.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false) const
Lookup and return a const sub-objectRegistry. Optionally create.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool checkOut()
Remove object from registry.
virtual bool readIfModified()
Read object if modified.
virtual void rename(const word &newName)
Rename.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
virtual bool modified() const
Return true if any of the object's files have been modified.
graph_traits< Graph >::vertices_size_type size_type
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
#define WarningIn(functionName)
Report a warning using Foam::Warning.
wordList sortedNames() const
Return the sorted list of names of the IOobjects.
virtual void rename(const word &newName)
Rename.
streamFormat
Enumeration for the format of data in the stream.
void store()
Transfer ownership of this object to its registry.
List< Key > toc() const
Return the table of contents.
void readModifiedObjects()
Read the objects that have been modified.
const word & name() const
Return name.
wordList names() const
Return the list of names of the IOobjects.
compressionType
Enumeration for the format of data in the stream.
bool checkIn()
Add object to registry.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Constant dispersed-phase particle diameter model.
bool ownedByRegistry() const
Is this object owned by the registry?
Registry of regIOobjects.
string & replace(const string &oldStr, const string &newStr, size_type start=0)
Replace first occurence of sub-string oldStr with newStr.
const Time & time() const
Return time.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
const fileName & caseName() const
Return case name.
const objectRegistry & db() const
Return the local objectRegistry.
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout,"Pout")
static const label labelMax