54 ownedByRegistry_(false),
56 eventNo_(isTimeObject ? 0 : db().getEvent()),
57 metaDataPtr_(nullptr),
72 ownedByRegistry_(false),
73 watchIndices_(rio.watchIndices_),
74 eventNo_(db().getEvent()),
75 metaDataPtr_(rio.metaDataPtr_.clone()),
86 ownedByRegistry_(false),
88 eventNo_(db().getEvent()),
89 metaDataPtr_(rio.metaDataPtr_.clone()),
107 const regIOobject& rio,
111 IOobject(newName, rio.instance(), rio.
local(), rio.db()),
113 ownedByRegistry_(false),
115 eventNo_(db().getEvent()),
116 metaDataPtr_(rio.metaDataPtr_.clone()),
132 const regIOobject& rio
137 ownedByRegistry_(false),
139 eventNo_(db().getEvent()),
140 metaDataPtr_(rio.metaDataPtr_.clone()),
156 Pout<<
"Destroy regIOobject: " <<
name()
157 <<
" type=" <<
type()
158 <<
" registered=" << registered_
159 <<
" owned=" << ownedByRegistry_
160 <<
" directory=" <<
path()
182 ownedByRegistry_ =
false;
197 registered_ = db().checkIn(*
this);
208 <<
"failed to register object " << objectPath()
209 <<
" the name already exists in the objectRegistry" <<
endl 210 <<
"Contents:" << db().sortedToc()
216 <<
"failed to register object " << objectPath()
217 <<
" the name already exists in the objectRegistry" 233 watchIndices_.clear();
239 return db().checkOut(
this);
254 && time().runTimeModifiable()
261 index = watchIndices_.size();
276 && time().runTimeModifiable()
279 fileName
f = filePath();
287 label index =
fileHandler().findWatch(watchIndices_,
f);
291 <<
"Object " << objectPath() <<
" of type " <<
type()
292 <<
" already watched with index " << watchIndices_[index]
298 const bool masterOnly
313 watchFiles.
resize(watchIndices_.size());
316 watchFiles[i] =
fileHandler().getFile(watchIndices_[i]);
329 watchIndices_.clear();
332 watchIndices_.append(
fileHandler().addWatch(watchFiles[i]));
344 label da = a.eventNo()-eventNo_;
383 const regIOobject& a,
387 return upToDate(a) && upToDate(
b);
398 return upToDate(a) && upToDate(
b) && upToDate(
c);
410 return upToDate(a) && upToDate(
b) && upToDate(
c) && upToDate(d);
416 eventNo_ = db().getEvent();
427 if (registerObject())
437 return localFilePath(
type());
454 <<
"failed to read header of file " << objectPath()
462 void Foam::regIOobject::operator=(
const IOobject&
io)
465 isPtr_.reset(
nullptr);
472 if (registerObject())
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
void operator=(const IOobject &io)
Copy assignment, copies all values (except the registry)
void resize(const label len)
Adjust allocated size of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void setUpToDate()
Set as up-to-date.
virtual void rename(const word &newName)
Rename the object.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
bool headerOk()
Read and check header info. Does not check the headerClassName.
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
virtual fileName filePath() const
Return complete path + object name if the file exists.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
#define forAll(list, i)
Loop across all elements in list.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
Reading required, file watched for runTime modification.
static word defaultRegion
Return the default region name.
errorManip< error > abort(error &err)
bool checkOut()
Remove all file watches and remove object from registry.
int debug
Static debugging option.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
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.
static bool masterOnlyReading
To flag master-only reading of objects.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
static bool master(const label communicator=worldComm)
Am I the master rank.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool registerObject() const noexcept
Should objects created with this IOobject be registered?
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< fileName > fileNameList
A List of fileNames.
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool checkIn()
Add object to registry, if not already registered.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
virtual ~regIOobject()
Destructor.