53 bool isHeaderOk =
false;
83void Foam::regIOobject::readStream(
const bool readOnProc)
88 <<
"NO_READ specified for read-constructor of object " <<
name()
89 <<
" of class " << headerClassName()
97 if (watchIndices_.size())
100 objPath =
fileHandler().getFile(watchIndices_.back());
105 objPath = filePath();
109 Pout<<
"regIOobject::readStream() : "
110 <<
"found object " <<
name()
111 <<
" (global " << global() <<
")"
112 <<
" in file " << objPath
122Foam::Istream& Foam::regIOobject::readStream
124 const word& expectName,
125 const bool readOnProc
130 Pout<<
"regIOobject::readStream(const word&) : "
131 <<
"reading object " <<
name()
132 <<
" of type " <<
type()
133 <<
" from file " << filePath()
140 readStream(readOnProc);
149 && headerClassName() != expectName
150 && headerClassName() !=
"dictionary"
154 <<
"unexpected class name " << headerClassName()
155 <<
" expected " << expectName <<
endl
156 <<
" while reading object " <<
name()
169 Pout<<
"regIOobject::close() : "
170 <<
"finished reading "
171 << (isPtr_ ? isPtr_->name() :
"dummy")
175 isPtr_.reset(
nullptr);
191 const bool masterOnly
200 const bool needWatch(!watchIndices_.empty());
202 if (!watchIndices_.empty())
208 watchIndices_.clear();
249 modified = watchIndices_[i];
258 if (modified == watchIndices_.back())
261 <<
" Re-reading object " <<
name()
262 <<
" from file " << fName <<
endl;
267 <<
" Re-reading object " <<
name()
268 <<
" from file " << fName
269 <<
" because of modified file "
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
@ NO_READ
Nothing to be read.
const word & headerClassName() const noexcept
Return name of the class name read from header.
static bool fileModificationChecking_masterOnly() noexcept
Test fileModificationChecking for master-only.
streamFormat
Data format (ascii | binary | coherent).
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
@ broadcast
broadcast [MPI]
static bool & parRun() noexcept
Test if this a parallel run.
A class for handling file names.
virtual bool modified() const
Return true if the object's file (or files for objectRegistry) have been modified....
virtual bool global() const
Is object global.
void close()
Close Istream.
virtual fileName filePath() const
Return complete path + object name if the file exists.
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.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED).
bool readHeaderOk(const IOstreamOption::streamFormat fmt, const word &typeName)
Helper: check readOpt flags and read if necessary.
virtual bool read()
Read object.
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.
bool read(const char *buf, int32_t &val)
Same as readInt32.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler().
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAllReverse(list, i)
Reverse loop across all elements in list.