Go to the documentation of this file.
51 ownedByRegistry_(false),
53 eventNo_(isTimeObject ? 0 : db().getEvent()),
54 metaDataPtr_(nullptr),
69 ownedByRegistry_(false),
70 watchIndices_(rio.watchIndices_),
71 eventNo_(db().getEvent()),
72 metaDataPtr_(rio.metaDataPtr_.clone()),
83 ownedByRegistry_(false),
85 eventNo_(db().getEvent()),
86 metaDataPtr_(rio.metaDataPtr_.clone()),
110 ownedByRegistry_(
false),
112 eventNo_(db().getEvent()),
113 metaDataPtr_(rio.metaDataPtr_.clone()),
134 ownedByRegistry_(
false),
136 eventNo_(db().getEvent()),
137 metaDataPtr_(rio.metaDataPtr_.clone()),
140 if (registerObject())
153 Pout<<
"Destroy regIOobject: " <<
name()
154 <<
" type=" <<
type()
155 <<
" registered=" << registered_
156 <<
" owned=" << ownedByRegistry_
157 <<
" directory=" <<
path()
179 ownedByRegistry_ =
false;
194 registered_ = db().checkIn(*
this);
205 <<
"failed to register object " << objectPath()
206 <<
" the name already exists in the objectRegistry" <<
endl
207 <<
"Contents:" << db().sortedToc()
213 <<
"failed to register object " << objectPath()
214 <<
" the name already exists in the objectRegistry"
230 watchIndices_.clear();
236 return db().checkOut(
this);
250 && readOpt() == MUST_READ_IF_MODIFIED
251 && time().runTimeModifiable()
258 index = watchIndices_.size();
272 && readOpt() == MUST_READ_IF_MODIFIED
273 && time().runTimeModifiable()
288 <<
"Object " << objectPath() <<
" of type " <<
type()
289 <<
" already watched with index " << watchIndices_[index]
308 watchFiles.
setSize(watchIndices_.size());
324 watchIndices_.clear();
327 watchIndices_.append(
fileHandler().addWatch(watchFiles[i]));
339 label da = a.
eventNo()-eventNo_;
382 return upToDate(a) && upToDate(
b);
393 return upToDate(a) && upToDate(
b) && upToDate(
c);
405 return upToDate(a) && upToDate(
b) && upToDate(
c) && upToDate(d);
411 eventNo_ = db().getEvent();
422 if (registerObject())
432 return localFilePath(
type());
449 <<
"failed to read header of file " << objectPath()
457 void Foam::regIOobject::operator=(
const IOobject& io)
460 isPtr_.reset(
nullptr);
467 if (registerObject())
int debug
Static debugging option.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
A class for handling file names.
bool registerObject() const noexcept
Should object created with this IOobject be registered?
static word defaultRegion
Return the default region name.
const fileName & instance() const noexcept
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
bool checkIn()
Add object to registry, if not already registered.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static bool master(const label communicator=worldComm)
Am I the master process.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
const fileOperation & fileHandler()
Get current file handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const =0
Read object header from supplied file.
label eventNo() const
Event number at last update.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
regIOobject(const IOobject &io, const bool isTimeObject=false)
#define forAll(list, i)
Loop across all elements in list.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
const fileName & local() const noexcept
void setSize(const label n)
Alias for resize()
static bool masterOnlyReading
To flag master-only reading of objects.
errorManip< error > abort(error &err)
virtual void rename(const word &newName)
Rename.
void setUpToDate()
Set as up-to-date.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
void operator=(const IOobject &io)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool checkOut()
Remove all file watches and remove object from registry.
virtual void rename(const word &newName)
Rename.
static bool & parRun() noexcept
Test if this a parallel run.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual fileName filePath() const
Return complete path + object name if the file exists.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
virtual label findWatch(const labelList &watchIndices, const fileName &) const
Find index (or -1) of file in list of handles.
const dimensionedScalar c
Speed of light in a vacuum.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
virtual ~regIOobject()
Destructor.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
bool headerOk()
Read and check header info.
const objectRegistry & db() const noexcept
Return the local objectRegistry.