48 bool isHeaderOk =
false;
90 <<
"Reading object " <<
name()
91 <<
" from file " << objectPath()
95 if (readOpt() == NO_READ)
98 <<
"NO_READ specified for read-constructor of object " <<
name()
99 <<
" of class " << headerClassName()
107 if (watchIndices_.size())
115 objPath = filePath();
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()
159 && headerClassName() != expectName
160 && headerClassName() != dictionary::typeName
163 if (expectName == dictionary::typeName)
165 const_cast<word&
>(
type()) = headerClassName();
170 <<
"Unexpected class name " << headerClassName()
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())
213 oldWatchFiles.
setSize(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.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
readOption readOpt() const
static fileCheckTypes fileModificationChecking
Type of file modification checking.
streamFormat
Enumeration for the format of data in the stream.
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.
void setSize(const label)
Reset size of List.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static bool master(const label communicator=0)
Am I the master process.
virtual bool read(regIOobject &, const bool masterOnly, const IOstream::streamFormat defaultFormat, const word &typeName) const =0
Top-level read.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
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 read=true) const =0
Reads header for regIOobject and returns an ISstream.
virtual bool modified() const
Return true if the object's file (or files for objectRegistry)
virtual bool global() const
Return true if object is global, i.e. same for all processors.
void close()
Close Istream.
bool headerOk()
Read and check header info.
virtual bool readIfModified()
Read object if modified (as set by call to modified)
virtual bool readData(Istream &)
Virtual readData function.
bool readHeaderOk(const IOstream::streamFormat defaultFormat, const word &typeName)
Read header, check readOpt flags and read data if necessary.
virtual bool read()
Read object.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
const fileOperation & fileHandler()
Get current file handler.
bool read(const char *, int32_t &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
prefixOSstream Pout(cout, "Pout")
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.