56 bool isHeaderOk =
false;
77 return fileHandler().read(*
this, masterOnly, fmt, typeName);
86 void Foam::regIOobject::readStream(
const bool valid)
91 <<
"NO_READ specified for read-constructor of object " <<
name()
92 <<
" of class " << headerClassName()
100 if (watchIndices_.size())
103 objPath =
fileHandler().getFile(watchIndices_.last());
108 objPath = filePath();
112 Pout<<
"regIOobject::readStream() : " 113 <<
"found object " <<
name()
114 <<
" (global " << global() <<
")" 115 <<
" in file " << objPath
127 const word& expectName,
133 Pout<<
"regIOobject::readStream(const word&) : " 134 <<
"reading object " <<
name()
135 <<
" of type " <<
type()
136 <<
" from file " << filePath()
152 && headerClassName() != expectName
153 && headerClassName() !=
"dictionary" 157 <<
"unexpected class name " << headerClassName()
158 <<
" expected " << expectName <<
endl 159 <<
" while reading object " <<
name()
172 Pout<<
"regIOobject::close() : " 173 <<
"finished reading " 174 << (isPtr_ ? isPtr_->name() :
"dummy")
178 isPtr_.reset(
nullptr);
197 if (watchIndices_.size())
199 oldWatchFiles.
setSize(watchIndices_.size());
202 oldWatchFiles[i] =
fileHandler().getFile(watchIndices_[i]);
208 watchIndices_.clear();
213 const bool masterOnly
227 if (oldWatchFiles.
size())
260 modified = watchIndices_[i];
267 const fileName fName =
fileHandler().getFile(watchIndices_.last());
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 " void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool read()
Read object.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
bool headerOk()
Read and check header info. Does not check the headerClassName.
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
bool isReadOptional() const noexcept
True if (READ_IF_PRESENT) bits are set.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
bool read(const char *buf, int32_t &val)
Same as readInt32.
#define forAll(list, i)
Loop across all elements in list.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void close()
Close Istream.
A class for handling words, derived from Foam::string.
virtual bool readIfModified()
Read object if modified (as set by call to modified)
errorManip< error > abort(error &err)
int debug
Static debugging option.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
bool isReadRequired() const noexcept
True if (MUST_READ | MUST_READ_IF_MODIFIED) bits are set.
virtual bool global() const
Is object global.
virtual bool readData(Istream &)
Virtual readData function.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual bool modified() const
Return true if the object's file (or files for objectRegistry) have been modified. (modified state is cached by Time)
static bool master(const label communicator=worldComm)
Am I the master rank.
streamFormat
Data format (ascii | binary)
#define forAllReverse(list, i)
Reverse loop across all elements in list.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
bool readHeaderOk(const IOstreamOption::streamFormat fmt, const word &typeName)
Helper: check readOpt flags and read if necessary.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
#define InfoInFunction
Report an information message using Foam::Info.