54 ownedByRegistry_(false),
55 eventNo_(isTimeObject ? 0 : db().getEvent()),
56 metaDataPtr_(nullptr),
71 ownedByRegistry_(false),
72 eventNo_(db().getEvent()),
73 watchFiles_(rio.watchFiles_),
74 watchIndices_(rio.watchIndices_),
75 metaDataPtr_(rio.metaDataPtr_.
clone()),
86 ownedByRegistry_(false),
87 eventNo_(db().getEvent()),
88 metaDataPtr_(rio.metaDataPtr_.clone()),
112 ownedByRegistry_(false),
113 eventNo_(db().getEvent()),
114 metaDataPtr_(rio.metaDataPtr_.clone()),
130 const regIOobject& rio
135 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 db().resetCacheTemporaryObject(
this);
182 ownedByRegistry_ =
false;
197 registered_ = db().checkIn(
this);
208 <<
"Failed to register: " <<
name() <<
' '
210 <<
" : the name already exists in the registry" <<
nl
217 <<
"Failed to register: " <<
name() <<
' '
219 <<
" : the name already exists in the registry" <<
endl;
234 watchIndices_.clear();
241 return db().checkOut(
this);
256 && time().runTimeModifiable()
270 index = watchFiles_.size();
271 watchFiles_.push_back(
f);
281 const bool masterOnly
298 &&
time().runTimeModifiable()
309 label index =
fileHandler().findWatch(watchIndices_,
f);
314 <<
" already watched with index " << watchIndices_[index]
329 filesToWatch.
resize(watchIndices_.size());
332 filesToWatch[i] =
fileHandler().getFile(watchIndices_[i]);
357 watchIndices_.clear();
358 for (
const auto& file : filesToWatch)
369 for (
const auto& file : watchFiles_)
381 watchIndices_.size()+watchFiles_.size()+1
385 for (
const label index : watchIndices_)
392 filesToWatch.
push_back(std::move(watchFiles_));
406 label da = a.
eventNo()-eventNo_;
478 eventNo_ =
db().getEvent();
513 if (!ok && IOobject::debug)
516 <<
"failed to read header of file " <<
objectPath()
527 isPtr_.reset(
nullptr);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void push_back(const T &val)
Copy append an element to the end of this list.
readOption readOpt() const noexcept
Get the read option.
bool registerObject() const noexcept
Should objects created with this IOobject be registered?
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
void operator=(const IOobject &io)
Copy assignment, copies all values (except the registry).
static bool fileModificationChecking_masterOnly() noexcept
Test fileModificationChecking for master-only.
const fileName & local() const noexcept
Read access to local path component.
fileName objectRelPath() const
The object path relative to the case.
fileName localFilePath(const word &typeName, const bool search=true) const
Redirect to fileHandler filePath, searching locally.
const fileName & instance() const noexcept
Read access to instance path component.
virtual void rename(const word &newName)
Rename the object.
autoPtr< IOobject > clone() const
Clone.
fileName objectPath() const
The complete path + object name.
void resize(const label len)
Adjust allocated size of list.
static void broadcasts(const int communicator, Type &value, Args &&... values)
Broadcast multiple items to all communicator ranks. Does nothing in non-parallel.
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
static bool & parRun() noexcept
Test if this a parallel run.
A class for handling file names.
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 bool global() const
Is object global.
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...
virtual fileName filePath() const
Return complete path + object name if the file exists.
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
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 object from registry, and remove all file watches.
void operator=(const regIOobject &)=delete
No copy assignment.
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.
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.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
List< fileName > fileNameList
List of fileName.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::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.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.