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 db().resetCacheTemporaryObject(
this);
185 ownedByRegistry_ =
false;
200 registered_ = db().checkIn(*
this);
211 <<
"failed to register object " << objectPath()
212 <<
" the name already exists in the objectRegistry" <<
endl 213 <<
"Contents:" << db().sortedToc()
219 <<
"failed to register object " << objectPath()
220 <<
" the name already exists in the objectRegistry" 236 watchIndices_.clear();
242 return db().checkOut(
this);
257 && time().runTimeModifiable()
264 index = watchIndices_.size();
279 && time().runTimeModifiable()
282 fileName
f = filePath();
290 label index =
fileHandler().findWatch(watchIndices_,
f);
294 <<
"Object " << objectPath() <<
" of type " <<
type()
295 <<
" already watched with index " << watchIndices_[index]
301 const bool masterOnly
316 watchFiles.
resize(watchIndices_.size());
319 watchFiles[i] =
fileHandler().getFile(watchIndices_[i]);
332 watchIndices_.clear();
335 watchIndices_.append(
fileHandler().addWatch(watchFiles[i]));
347 label da = a.eventNo()-eventNo_;
386 const regIOobject& a,
390 return upToDate(a) && upToDate(
b);
401 return upToDate(a) && upToDate(
b) && upToDate(
c);
413 return upToDate(a) && upToDate(
b) && upToDate(
c) && upToDate(d);
419 eventNo_ = db().getEvent();
430 if (registerObject())
440 return localFilePath(
type());
457 <<
"failed to read header of file " << objectPath()
465 void Foam::regIOobject::operator=(
const IOobject&
io)
468 isPtr_.reset(
nullptr);
475 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.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::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.
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.
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)
True if process corresponds to the master rank in the communicator.
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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
List< fileName > fileNameList
List of fileName.
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.