45 ownedByRegistry_(false),
47 eventNo_(isTime ? 0 : db().getEvent())
61 const bool registerObject
64 IOobject(newName, io.instance(), io.local(), io.db()),
66 ownedByRegistry_(false),
68 eventNo_(db().getEvent())
81 ownedByRegistry_(false),
82 watchIndices_(rio.watchIndices_),
83 eventNo_(db().getEvent())
93 ownedByRegistry_(false),
95 eventNo_(db().getEvent())
109 ownedByRegistry_(false),
111 eventNo_(db().getEvent())
128 if (objectRegistry::debug)
132 Pout<<
"Destroying objectRegistry " <<
name()
134 << rootPath()/caseName()/instance()
139 Pout<<
"Destroying regIOobject " <<
name()
140 <<
" in directory " << path()
145 db().resetCacheTemporaryObject(*
this);
148 if (!ownedByRegistry_)
187 registered_ = db().checkIn(*
this);
198 <<
"failed to register object " << objectPath()
199 <<
" the name already exists in the objectRegistry" <<
endl
200 <<
"Contents:" << db().sortedToc()
206 <<
"failed to register object " << objectPath()
207 <<
" the name already exists in the objectRegistry"
227 watchIndices_.clear();
228 return db().checkOut(*
this);
240 && readOpt() == MUST_READ_IF_MODIFIED
241 &&
time().runTimeModifiable()
256 <<
"Object " << objectPath() <<
" of type " <<
type()
257 <<
" already watched with index " << watchIndices_[index]
276 watchFiles.
setSize(watchIndices_.size());
292 watchIndices_.clear();
295 watchIndices_.append(
fileHandler().addWatch(watchFiles[i]));
350 ||
c.eventNo() >= eventNo_
374 ||
c.eventNo() >= eventNo_
389 eventNo_ = db().getEvent();
397 if (newName !=
name())
399 const bool ownedByRegistry0 = ownedByRegistry();
407 if (registerObject())
410 if (ownedByRegistry0)
439 if (IOobject::debug && (!ok || headerClassName() !=
type()))
442 <<
"failed to read header of file " << objectPath()
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fileName & caseName(const bool global) const
bool & registerObject()
Register object created from this IOobject with registry if true.
fileName filePath(const bool global) const
Return complete path + object name if the file exists.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void rename(const word &newName)
Rename.
fileName path(const bool global) const
Return complete path including the processor sub-directory.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static bool master(const label communicator=0)
Am I the master process.
static bool & parRun()
Is this a parallel run?
A class for handling file names.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
virtual label findWatch(const labelList &watchIndices, const fileName &) const
Find index (or -1) of file in list of handles.
virtual bool readHeader(IOobject &, const fileName &, const word &typeName) const =0
Read object header from supplied file.
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
static word defaultRegion
Return the default region name.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const fileName & caseName() const
void setUpToDate()
Set up to date (obviously)
virtual bool global() const
Return true if object is global, i.e. same for all processors.
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.
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
bool headerOk()
Read and check header info.
virtual bool globalFile() const
Return true if object is global, i.e. same for all processors.
fileName path() const
Return complete path.
bool checkOut()
Remove object from registry.
virtual ~regIOobject()
Destructor.
void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
uint64_t eventNo() const
Event number at last update.
virtual void rename(const word &newName)
Rename.
bool checkIn()
Add object to registry.
A class for handling words, derived from string.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
const fileOperation & fileHandler()
Get current file handler.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
prefixOSstream Pout(cout, "Pout")
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.