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
88 Foam::Istream& Foam::regIOobject::readStream(
const bool valid)
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()
168 <<
" expected " << expectName <<
endl 169 <<
" while reading object " <<
name()
182 Pout<<
"regIOobject::close() : " 183 <<
"finished reading " << isPtr_().name()
206 if (watchIndices_.
size())
217 watchIndices_.
clear();
233 if (oldWatchFiles.
size())
266 modified = watchIndices_[i];
275 if (modified == watchIndices_.
last())
277 Info<<
"regIOobject::readIfModified() : " <<
nl 278 <<
" Re-reading object " <<
name()
279 <<
" from file " << fName <<
endl;
283 Info<<
"regIOobject::readIfModified() : " <<
nl 284 <<
" Re-reading object " <<
name()
285 <<
" from file " << fName
286 <<
" 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 valid=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)
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
virtual bool global() const
Is object global.
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)
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.