46 headerClassName_.clear();
66 fName = typeFilePath<Type>(*
this,
search);
67 ok = fp.
readHeader(*
this, fName, Type::typeName);
70 if (ok && checkType && headerClassName_ != Type::typeName)
76 <<
"Unexpected class name \"" << headerClassName_
77 <<
"\" expected \"" << Type::typeName
78 <<
"\" when reading " << fName <<
endl;
98 << Type::typeName <<
' ' <<
name()
99 <<
" constructed with READ_MODIFIED but " 100 << Type::typeName <<
" does not support automatic rereading." A class for handling file names.
Ostream & endl(Ostream &os)
Add newline and flush stream.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
An encapsulation of filesystem-related operations.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
#define WarningInFunction
Report a warning using Foam::Warning.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
void warnNoRereading() const
Helper: warn that type does not support re-reading.
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const =0
Read object header from supplied file.