Go to the documentation of this file.
48 IOobject::fileModificationChecking == IOobject::timeStampMaster
49 || IOobject::fileModificationChecking == IOobject::inotifyMaster
54 bool isHeaderOk =
false;
55 if (readOpt() == IOobject::READ_IF_PRESENT)
59 if (Pstream::master())
61 isHeaderOk = headerOk();
63 Pstream::scatter(isHeaderOk);
67 isHeaderOk = headerOk();
74 readOpt() == IOobject::MUST_READ
75 || readOpt() == IOobject::MUST_READ_IF_MODIFIED
89 void Foam::regIOobject::readStream(
const bool valid)
94 <<
"NO_READ specified for read-constructor of object " <<
name()
103 if (watchIndices_.size())
115 Pout<<
"regIOobject::readStream() : "
116 <<
"found object " <<
name()
117 <<
" (global " <<
global() <<
")"
118 <<
" in file " << objPath
130 const word& expectName,
136 Pout<<
"regIOobject::readStream(const word&) : "
137 <<
"reading object " <<
name()
138 <<
" of type " <<
type()
139 <<
" from file " << filePath()
155 && headerClassName() != expectName
156 && headerClassName() !=
"dictionary"
160 <<
"unexpected class name " << headerClassName()
161 <<
" expected " << expectName <<
endl
162 <<
" while reading object " <<
name()
175 Pout<<
"regIOobject::close() : "
176 <<
"finished reading "
177 << (isPtr_ ? isPtr_->name() :
"dummy")
181 isPtr_.reset(
nullptr);
200 if (watchIndices_.size())
202 oldWatchFiles.
setSize(watchIndices_.size());
211 watchIndices_.clear();
227 if (oldWatchFiles.size())
260 modified = watchIndices_[i];
269 if (modified == watchIndices_.last())
272 <<
" Re-reading object " <<
name()
273 <<
" from file " << fName <<
endl;
278 <<
" Re-reading object " <<
name()
279 <<
" from file " << fName
280 <<
" because of modified file "
int debug
Static debugging option.
#define InfoInFunction
Report an information message using Foam::Info.
A class for handling words, derived from Foam::string.
A class for handling file names.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool read()
Read object.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual bool global() const
Is object global.
const fileOperation & fileHandler()
Get current file handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const word & headerClassName() const noexcept
Return name of the class name read from header.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool valid=true) const =0
Reads header for regIOobject and returns an ISstream.
virtual bool modified() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void setSize(const label n)
Alias for resize()
virtual bool readIfModified()
Read object if modified (as set by call to modified)
streamFormat
Data format (ascii | binary)
errorManip< error > abort(error &err)
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
readOption readOpt() const noexcept
The read option.
const word & name() const noexcept
Return name.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void close()
Close Istream.
virtual bool read(regIOobject &, const bool masterOnly, const IOstreamOption::streamFormat format, const word &typeName) const =0
Top-level read.
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.
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.
virtual bool readData(Istream &)
Virtual readData function.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
bool readHeaderOk(const IOstreamOption::streamFormat fmt, const word &typeName)
Helper: check readOpt flags and read if necessary.