45 "fileModificationSkew",
51 bool Foam::regIOobject::masterOnlyReading =
false;
60 ownedByRegistry_(false),
81 ownedByRegistry_(false),
82 watchIndices_(rio.watchIndices_),
83 eventNo_(
db().getEvent())
93 ownedByRegistry_(false),
95 eventNo_(
db().getEvent())
97 if (registerCopy && rio.registered_)
114 ownedByRegistry_(
false),
116 eventNo_(
db().getEvent())
133 ownedByRegistry_(
false),
135 eventNo_(
db().getEvent())
148 if (objectRegistry::debug)
152 Pout<<
"Destroying objectRegistry " <<
name()
158 Pout<<
"Destroying regIOobject " <<
name()
159 <<
" in directory " <<
path()
165 if (!ownedByRegistry_)
191 <<
"failed to register object " <<
objectPath()
192 <<
" the name already exists in the objectRegistry" <<
endl 199 <<
"failed to register object " <<
objectPath()
200 <<
" the name already exists in the objectRegistry" 220 watchIndices_.
clear();
236 &&
time().runTimeModifiable()
243 index = watchIndices_.
size();
257 &&
time().runTimeModifiable()
273 <<
" already watched with index " << watchIndices_[index]
308 watchIndices_.
clear();
440 if (!ok && IOobject::debug)
443 <<
"failed to read header of file " <<
objectPath()
451 void Foam::regIOobject::operator=(
const IOobject& io)
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
A class for handling file names.
float floatOptimisationSwitch(const char *name, const float defaultValue=0)
Lookup optimisation switch or add default value.
void operator=(const IOobject &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void setUpToDate()
Set up to date (obviously)
void size(const label)
Override size to be inconsistent with allocated storage.
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
virtual void rename(const word &newName)
Rename.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool checkOut(regIOobject &) const
Remove an regIOobject from registry.
bool headerOk()
Read and check header info.
static bool master(const label communicator=0)
Am I the master process.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
virtual fileName filePath() const
Return complete path + object name if the file exists.
regIOobject(const IOobject &, const bool isTime=false)
Construct from IOobject. Optional flag for if IOobject is the.
fileName path() const
Return complete path.
fileName localFilePath(const word &typeName) const
Helper for filePath that searches locally.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
void append(const T &)
Append an element at the end of the list.
label getEvent() const
Return new event number.
const fileName & local() const
label eventNo() const
Event number at last update.
const fileOperation & fileHandler()
Get current file handler.
errorManip< error > abort(error &err)
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
bool checkOut()
Remove object from registry.
registerOptSwitch("fileModificationSkew", float, Foam::regIOobject::fileModificationSkew)
defineTypeNameAndDebug(combustionModel, 0)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
virtual void rename(const word &newName)
Rename.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
virtual bool global() const
Is object global.
const fileName & rootPath() const
void setSize(const label)
Reset size of List.
static bool & parRun()
Is this a parallel run?
const fileName & instance() const
#define WarningInFunction
Report a warning using Foam::Warning.
const Time & time() const
Return time.
prefixOSstream Pout(cout, "Pout")
List< Key > sortedToc() const
Return the table of contents as a sorted list.
bool checkIn(regIOobject &) const
Add an regIOobject to registry.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
static float fileModificationSkew
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
const objectRegistry & db() const
Return the local objectRegistry.
virtual label findWatch(const labelList &watchIndices, const fileName &) const
Find index (or -1) of file in list of handles.
bool & registerObject()
Register object created from this IOobject with registry if true.
readOption readOpt() const
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fileName & caseName() const
fileName objectPath() const
Return complete path + object name.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
bool checkIn()
Add object to registry.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const =0
Read object header from supplied file.
virtual ~regIOobject()
Destructor.