40 const bool masterOnly =
54 filePath(Type::typeName, typeGlobalFile<Type>())
57 ok = fp.
readHeader(*
this, fName, Type::typeName);
58 if (ok && checkType && headerClassName_ != Type::typeName)
61 <<
"unexpected class name " << headerClassName_
62 <<
" expected " << Type::typeName
63 <<
" when reading " << fName <<
endl;
85 << Type::typeName <<
' ' <<
name()
86 <<
" constructed with IOobject::MUST_READ_IF_MODIFIED" 87 " but " << Type::typeName
88 <<
" does not support automatic rereading." 97 return typeHeaderOk<Type>(
true);
bool typeHeaderOk(const bool checkType)
Read header using typeGlobalFile to find file.
const word & name() const
Return name.
A class for handling file names.
bool headerOk()
Read header (uses typeGlobalFile to find file) and check.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
fileName filePath(const word &typeName, const bool global) const
Return complete path + object name if the file exists.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
const fileOperation & fileHandler()
Get current file handler.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
#define WarningInFunction
Report a warning using Foam::Warning.
readOption readOpt() const
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.