Go to the documentation of this file.
48 regIOobject::fileModificationChecking == timeStampMaster
49 || regIOobject::fileModificationChecking == 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 Foam::Istream& Foam::regIOobject::readStream(
const bool valid)
93 Pout<<
"regIOobject::readStream() : "
94 <<
"reading object " <<
name()
95 <<
" (global " <<
global() <<
")"
103 <<
"NO_READ specified for read-constructor of object " <<
name()
112 if (watchIndices_.size())
124 Pout<<
"regIOobject::readStream() : "
125 <<
"found object " <<
name()
126 <<
" (global " <<
global() <<
")"
127 <<
" in file " << objPath
141 const word& expectName,
147 Pout<<
"regIOobject::readStream(const word&) : "
148 <<
"reading object " <<
name()
149 <<
" of type " <<
type()
150 <<
" from file " << filePath()
166 && headerClassName() != expectName
167 && headerClassName() !=
"dictionary"
171 <<
"unexpected class name " << headerClassName()
172 <<
" expected " << expectName <<
endl
173 <<
" while reading object " <<
name()
186 Pout<<
"regIOobject::close() : "
187 <<
"finished reading "
188 << (isPtr_.valid() ? isPtr_().name() :
"dummy")
211 if (watchIndices_.size())
213 oldWatchFiles.
setSize(watchIndices_.size());
222 watchIndices_.clear();
238 if (oldWatchFiles.size())
271 modified = watchIndices_[i];
280 if (modified == watchIndices_.last())
283 <<
" Re-reading object " <<
name()
284 <<
" from file " << fName <<
endl;
289 <<
" Re-reading object " <<
name()
290 <<
" from file " << fName
291 <<
" because of modified file "
int debug
Static debugging option.
#define InfoInFunction
Report an information message using Foam::Info.
const word & name() const
Return name.
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.
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)
virtual bool read(regIOobject &, const bool masterOnly, const IOstream::streamFormat format, const word &typeName) const =0
Top-level read.
virtual autoPtr< ISstream > readStream(regIOobject &, const fileName &, const word &typeName, const bool valid=true) const =0
Reads header for regIOobject and returns an ISstream.
word format(conversionProperties.get< word >("format"))
bool readHeaderOk(const IOstream::streamFormat PstreamFormat, const word &typeName)
Helper: check readOpt flags and read if necessary.
virtual bool modified() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
word name(const complex &c)
Return string representation of complex.
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)
const word & headerClassName() const
Return name of the class name read from header.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void close()
Close Istream.
readOption readOpt() const
The read option.
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.
#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.
fileName objectPath() const
The complete path + object name.
void setSize(const label newSize)
Alias for resize(const label)