42 regIOobject::fileModificationChecking == timeStampMaster
43 || regIOobject::fileModificationChecking == inotifyMaster
48 bool isHeaderOk =
false;
49 if (readOpt() == IOobject::READ_IF_PRESENT)
53 if (Pstream::master())
55 isHeaderOk = headerOk();
57 Pstream::scatter(isHeaderOk);
61 isHeaderOk = headerOk();
68 readOpt() == IOobject::MUST_READ
69 || readOpt() == IOobject::MUST_READ_IF_MODIFIED
90 <<
"Reading object " <<
name()
98 <<
"NO_READ specified for read-constructor of object " <<
name()
107 if (watchIndices_.
size())
119 Pout<<
"regIOobject::readStream() : " 120 <<
"found object " <<
name()
121 <<
" (global " <<
global() <<
")" 122 <<
" in file " << objPath
136 const word& expectName,
142 Pout<<
"regIOobject::readStream(const word&) : " 143 <<
"reading object " <<
name()
163 if (expectName == dictionary::typeName)
171 <<
" expected " << expectName <<
endl 172 <<
" while reading object " <<
name()
186 Pout<<
"regIOobject::close() : " 187 <<
"finished reading " 188 << (isPtr_.valid() ? isPtr_().name() :
"dummy")
211 if (watchIndices_.
size())
222 watchIndices_.
clear();
238 if (oldWatchFiles.
size())
271 modified = watchIndices_[i];
280 if (modified == watchIndices_.
last())
282 Info<<
"regIOobject::readIfModified() : " <<
nl 283 <<
" Re-reading object " <<
name()
284 <<
" from file " << fName <<
endl;
288 Info<<
"regIOobject::readIfModified() : " <<
nl 289 <<
" Re-reading object " <<
name()
290 <<
" from file " << fName
291 <<
" because of modified file "
#define forAll(list, i)
Loop across all elements in list.
bool readHeaderOk(const IOstream::streamFormat defaultFormat, const word &typeName)
Read header, check readOpt flags and read data if necessary.
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(regIOobject &, const bool masterOnly, const IOstream::streamFormat defaultFormat, const word &typeName) const =0
Top-level read.
virtual bool read()
Read object.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
fileName objectPath() const
Return complete path + object name.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
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.
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
Return true if object is global, i.e. same for all processors.
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.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
#define InfoInFunction
Report an information message using Foam::Info.