45 regIOobject::fileModificationChecking == timeStampMaster
46 || regIOobject::fileModificationChecking == inotifyMaster
51 bool isHeaderOk =
false;
52 if (readOpt() == IOobject::READ_IF_PRESENT)
56 if (Pstream::master())
58 isHeaderOk = headerOk();
60 Pstream::scatter(isHeaderOk);
64 isHeaderOk = headerOk();
71 readOpt() == IOobject::MUST_READ
72 || readOpt() == IOobject::MUST_READ_IF_MODIFIED
93 <<
"Reading object " <<
name()
101 <<
"NO_READ specified for read-constructor of object " <<
name()
110 if (watchIndices_.
size())
122 Pout<<
"regIOobject::readStream() : " 123 <<
"found object " <<
name()
124 <<
" (global " <<
global() <<
")" 125 <<
" in file " << objPath
139 const word& expectName,
145 Pout<<
"regIOobject::readStream(const word&) : " 146 <<
"reading object " <<
name()
166 if (expectName == dictionary::typeName)
174 <<
" expected " << expectName <<
endl 175 <<
" while reading object " <<
name()
189 Pout<<
"regIOobject::close() : " 190 <<
"finished reading " 191 << (isPtr_.valid() ? isPtr_().name() :
"dummy")
214 if (watchIndices_.
size())
225 watchIndices_.
clear();
241 if (oldWatchFiles.
size())
274 modified = watchIndices_[i];
283 if (modified == watchIndices_.
last())
285 Info<<
"regIOobject::readIfModified() : " <<
nl 286 <<
" Re-reading object " <<
name()
287 <<
" from file " << fName <<
endl;
291 Info<<
"regIOobject::readIfModified() : " <<
nl 292 <<
" Re-reading object " <<
name()
293 <<
" from file " << fName
294 <<
" because of modified file "
#define forAll(list, i)
Loop across all elements in list.
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 word & name() const
Return name.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool read()
Read object.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
virtual fileName filePath() const
Return complete path + object name if the file exists.
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool read=true) const =0
Reads header for regIOobject and returns an ISstream.
void close()
Close Istream.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
virtual bool readIfModified()
Read object if modified (as set by call to modified)
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
streamFormat
Enumeration for the format of data in the stream.
const fileOperation & fileHandler()
Get current file handler.
errorManip< error > abort(error &err)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
void setSize(const label)
Reset size of List.
virtual bool readData(Istream &)
Virtual readData function.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
prefixOSstream Pout(cout, "Pout")
virtual bool modified() const
Return true if the object's file (or files for objectRegistry)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
virtual bool global() const
Is object same for all processors.
virtual bool read(regIOobject &, const bool masterOnly, const IOstream::streamFormat format, const word &typeName) const =0
Top-level read.
T & last()
Return the last element of the list.
readOption readOpt() const
const word & headerClassName() const
Return name of the class name read from header.
fileName objectPath() const
Return complete path + object name.
bool readHeaderOk(const IOstream::streamFormat PstreamFormat, const word &typeName)
Helper: check readOpt flags and read if necessary.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
#define InfoInFunction
Report an information message using Foam::Info.