56 bool isHeaderOk =
false;
91void Foam::regIOobject::readStream(
const bool valid)
93 if (readOpt() == NO_READ)
96 <<
"NO_READ specified for read-constructor of object " <<
name()
97 <<
" of class " << headerClassName()
105 if (watchIndices_.size())
113 objPath = filePath();
117 Pout<<
"regIOobject::readStream() : "
118 <<
"found object " <<
name()
119 <<
" (global " << global() <<
")"
120 <<
" in file " << objPath
132 const word& expectName,
138 Pout<<
"regIOobject::readStream(const word&) : "
139 <<
"reading object " <<
name()
140 <<
" of type " <<
type()
141 <<
" from file " << filePath()
157 && headerClassName() != expectName
158 && headerClassName() !=
"dictionary"
162 <<
"unexpected class name " << headerClassName()
163 <<
" expected " << expectName <<
endl
164 <<
" while reading object " <<
name()
177 Pout<<
"regIOobject::close() : "
178 <<
"finished reading "
179 << (isPtr_ ? isPtr_->name() :
"dummy")
183 isPtr_.reset(
nullptr);
202 if (watchIndices_.size())
204 oldWatchFiles.
setSize(watchIndices_.size());
213 watchIndices_.clear();
218 const bool masterOnly
231 if (oldWatchFiles.
size())
264 modified = watchIndices_[i];
273 if (modified == watchIndices_.last())
276 <<
" Re-reading object " <<
name()
277 <<
" from file " << fName <<
endl;
282 <<
" Re-reading object " <<
name()
283 <<
" from file " << fName
284 <<
" because of modified file "
readOption readOpt() const noexcept
The read option.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
streamFormat
Data format (ascii | binary)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void setSize(const label n)
Alias for resize()
static void broadcast(Type &value, const label comm=UPstream::worldComm)
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
virtual bool read(regIOobject &, const bool masterOnly, const IOstreamOption::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.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
virtual bool modified() const
virtual bool global() const
Is object global.
void close()
Close Istream.
bool headerOk()
Read and check header info. Does not check the headerClassName.
virtual bool readIfModified()
Read object if modified (as set by call to modified)
virtual bool readData(Istream &)
Virtual readData function.
bool readHeaderOk(const IOstreamOption::streamFormat fmt, const word &typeName)
Helper: check readOpt flags and read if necessary.
virtual bool read()
Read object.
splitCell * master() const
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define InfoInFunction
Report an information message using Foam::Info.
const fileOperation & fileHandler()
Get current file handler.
bool read(const char *buf, int32_t &val)
Same as readInt32.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.