45 ownedByRegistry_(false),
66 ownedByRegistry_(false),
67 watchIndices_(rio.watchIndices_),
68 eventNo_(db().getEvent())
78 ownedByRegistry_(false),
80 eventNo_(db().getEvent())
94 ownedByRegistry_(false),
96 eventNo_(db().getEvent())
116 IOobject(newName, rio.instance(), rio.local(), rio.db()),
118 ownedByRegistry_(false),
120 eventNo_(db().getEvent())
137 ownedByRegistry_(false),
139 eventNo_(db().getEvent())
152 if (objectRegistry::debug)
156 Pout<<
"Destroying objectRegistry " <<
name()
158 << rootPath()/caseName()/instance()
163 Pout<<
"Destroying regIOobject " <<
name()
164 <<
" in directory " << path()
169 db().resetCacheTemporaryObject(*
this);
172 if (!ownedByRegistry_)
211 registered_ = db().checkIn(*
this);
222 <<
"failed to register object " << objectPath()
223 <<
" the name already exists in the objectRegistry" <<
endl
224 <<
"Contents:" << db().sortedToc()
230 <<
"failed to register object " << objectPath()
231 <<
" the name already exists in the objectRegistry"
251 watchIndices_.clear();
252 return db().checkOut(*
this);
264 && readOpt() == MUST_READ_IF_MODIFIED
265 && time().runTimeModifiable()
280 <<
"Object " << objectPath() <<
" of type " <<
type()
281 <<
" already watched with index " << watchIndices_[index]
300 watchFiles.
setSize(watchIndices_.size());
316 watchIndices_.clear();
319 watchIndices_.append(
fileHandler().addWatch(watchFiles[i]));
374 ||
c.eventNo() >= eventNo_
398 ||
c.eventNo() >= eventNo_
413 eventNo_ = db().getEvent();
421 if (newName !=
name())
423 const bool ownedByRegistry0 = ownedByRegistry();
431 if (registerObject())
434 if (ownedByRegistry0)
463 if (IOobject::debug && (!ok || headerClassName() !=
type()))
466 <<
"failed to read header of file " << objectPath()
479 const bool ownedByRegistry0 = ownedByRegistry();
487 if (registerObject())
490 if (ownedByRegistry0)
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fileName & caseName(const bool global) const
fileName filePath(const word &typeName, const bool global) const
Return complete path + object name if the file exists.
bool & registerObject()
Register object created from this IOobject with registry if true.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void rename(const word &newName)
Rename.
void operator=(const IOobject &)
fileName path(const bool global) const
Return complete path including the processor sub-directory.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static bool master(const label communicator=0)
Am I the master process.
static bool & parRun()
Is this a parallel run?
A class for handling file names.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
virtual label findWatch(const labelList &watchIndices, const fileName &) const
Find index (or -1) of file in list of handles.
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const =0
Read object header from supplied file.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
static word defaultRegion
Return the default region name.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const fileName & caseName() const
void setUpToDate()
Set up to date (obviously)
virtual bool global() const
Return true if object is global, i.e. same for all processors.
fileName filePath() const
Return complete path + object name if the file exists.
regIOobject(const IOobject &, const bool isTime=false)
Construct from IOobject. Optional flag for if IOobject is the.
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
bool headerOk()
Read and check header info.
label eventNo() const
Event number at last update.
virtual bool globalFile() const
Return true if object is global, i.e. same for all processors.
fileName path() const
Return complete path.
void operator=(const IOobject &)
Assign to IOobject.
bool checkOut()
Remove object from registry.
virtual ~regIOobject()
Destructor.
void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
virtual void rename(const word &newName)
Rename.
bool checkIn()
Add object to registry.
A class for handling words, derived from string.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
const fileOperation & fileHandler()
Get current file handler.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.