51 ownedByRegistry_(false),
53 eventNo_(isTimeObject ? 0 : db().getEvent()),
54 metaDataPtr_(nullptr),
69 ownedByRegistry_(false),
70 watchIndices_(rio.watchIndices_),
71 eventNo_(db().getEvent()),
72 metaDataPtr_(rio.metaDataPtr_.clone()),
83 ownedByRegistry_(false),
85 eventNo_(db().getEvent()),
86 metaDataPtr_(rio.metaDataPtr_.clone()),
108 IOobject(newName, rio.instance(), rio.local(), rio.db()),
110 ownedByRegistry_(false),
112 eventNo_(db().getEvent()),
113 metaDataPtr_(rio.metaDataPtr_.clone()),
134 ownedByRegistry_(false),
136 eventNo_(db().getEvent()),
137 metaDataPtr_(rio.metaDataPtr_.clone()),
151 if (objectRegistry::debug)
153 Pout<<
"Destroy regIOobject: " <<
name()
154 <<
" type=" <<
type()
155 <<
" registered=" << registered_
156 <<
" owned=" << ownedByRegistry_
157 <<
" directory=" <<
path()
179 ownedByRegistry_ =
false;
194 registered_ = db().checkIn(*
this);
205 <<
"failed to register object " << objectPath()
206 <<
" the name already exists in the objectRegistry" <<
endl
207 <<
"Contents:" << db().sortedToc()
213 <<
"failed to register object " << objectPath()
214 <<
" the name already exists in the objectRegistry"
230 watchIndices_.clear();
236 return db().checkOut(
this);
251 && time().runTimeModifiable()
258 index = watchIndices_.size();
273 && time().runTimeModifiable()
288 <<
"Object " << objectPath() <<
" of type " <<
type()
289 <<
" already watched with index " << watchIndices_[index]
295 const bool masterOnly
310 watchFiles.
resize(watchIndices_.size());
326 watchIndices_.clear();
329 watchIndices_.append(
fileHandler().addWatch(watchFiles[i]));
341 label da = a.
eventNo()-eventNo_;
384 return upToDate(a) && upToDate(
b);
395 return upToDate(a) && upToDate(
b) && upToDate(c);
407 return upToDate(a) && upToDate(
b) && upToDate(c) && upToDate(d);
413 eventNo_ = db().getEvent();
424 if (registerObject())
434 return localFilePath(
type());
448 if (!ok && IOobject::debug)
451 <<
"failed to read header of file " << objectPath()
462 isPtr_.reset(
nullptr);
469 if (registerObject())
bool upToDate() const
Access to the up-to-date flag.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool registerObject() const noexcept
Should object created with this IOobject be registered?
void operator=(const IOobject &io)
Copy assignment, copies all values (except the registry)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void rename(const word &newName)
Rename the object.
void resize(const label len)
Adjust allocated size of list.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if 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...
void setUpToDate()
Set as up-to-date.
virtual fileName filePath() const
Return complete path + object name if the file exists.
static bool masterOnlyReading
To flag master-only reading of objects.
bool headerOk()
Read and check header info. Does not check the headerClassName.
label eventNo() const noexcept
Event number at last update.
bool checkOut()
Remove all file watches and remove object from registry.
virtual ~regIOobject()
Destructor.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
virtual void rename(const word &newName)
Rename.
bool checkIn()
Add object to registry, if not already registered.
splitCell * master() const
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
const fileOperation & fileHandler()
Get current file handler.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.