Go to the documentation of this file.
48 "fileModificationSkew",
59 "maxFileModificationPolls",
74 ownedByRegistry_(false),
76 eventNo_(isTime ? 0 : db().getEvent())
90 ownedByRegistry_(false),
91 watchIndices_(rio.watchIndices_),
92 eventNo_(db().getEvent()),
103 ownedByRegistry_(false),
105 eventNo_(db().getEvent()),
129 ownedByRegistry_(
false),
131 eventNo_(db().getEvent()),
152 ownedByRegistry_(
false),
154 eventNo_(db().getEvent()),
157 if (registerObject())
170 Pout<<
"Destroy regIOobject: " <<
name()
171 <<
" type=" <<
type()
172 <<
" registered=" << registered_
173 <<
" owned=" << ownedByRegistry_
174 <<
" directory=" <<
path()
196 ownedByRegistry_ =
false;
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"
247 watchIndices_.clear();
253 return db().checkOut(
this);
267 && readOpt() == MUST_READ_IF_MODIFIED
268 && time().runTimeModifiable()
275 index = watchIndices_.size();
289 && readOpt() == MUST_READ_IF_MODIFIED
290 && time().runTimeModifiable()
305 <<
"Object " << objectPath() <<
" of type " <<
type()
306 <<
" already watched with index " << watchIndices_[index]
325 watchFiles.
setSize(watchIndices_.size());
341 watchIndices_.clear();
344 watchIndices_.append(
fileHandler().addWatch(watchFiles[i]));
356 label da = a.
eventNo()-eventNo_;
399 return upToDate(a) && upToDate(
b);
410 return upToDate(a) && upToDate(
b) && upToDate(
c);
422 return upToDate(a) && upToDate(
b) && upToDate(
c) && upToDate(d);
428 eventNo_ = db().getEvent();
439 if (registerObject())
449 return localFilePath(
type());
466 <<
"failed to read header of file " << objectPath()
474 void Foam::regIOobject::operator=(
const IOobject& io)
484 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.
static word defaultRegion
Return the default region name.
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
static float fileModificationSkew
const fileName & instance() const
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
regIOobject(const IOobject &io, const bool isTime=false)
static bool & parRun()
Is this a parallel run?
bool checkIn()
Add object to registry, if not already registered.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static int maxFileModificationPolls
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
An Ostream wrapper for parallel output to std::cout.
#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 objectRegistry & db() const
Return the local objectRegistry.
bool registerObject() const
Should object created with this IOobject be registered?
const fileName & local() const
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
word name(const complex &c)
Return string representation of complex.
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
static bool masterOnlyReading
To flag master-only reading of objects.
errorManip< error > abort(error &err)
registerOptSwitch("fileModificationSkew", float, Foam::regIOobject::fileModificationSkew)
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)
static bool master(const label communicator=0)
Am I the master process.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
float floatOptimisationSwitch(const char *name, const float deflt=0)
Lookup optimisation switch or add default value.
bool checkOut()
Remove all file watches and remove object from registry.
virtual void rename(const word &newName)
Rename.
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.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
virtual ~regIOobject()
Destructor.
void setSize(const label newSize)
Alias for resize(const label)
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
bool headerOk()
Read and check header info.