Go to the documentation of this file.
33 return ownedByRegistry_;
41 ownedByRegistry_ =
true;
46 <<
"Refuse to store unregistered object: " << this->
name() <<
nl;
49 return ownedByRegistry_;
59 <<
"Object deallocated\n"
63 const bool ok =
p->regIOobject::store();
68 <<
"Failed to store pointer: " <<
p->regIOobject::name()
69 <<
". Risk of memory leakage\n"
89 return store(ptr.release());
118 <<
"Refuse to store reference: " <<
p->name()
119 <<
". Likely indicates a coding error\n";
159 <<
"Refuse to store reference: " <<
p->name()
160 <<
". Likely indicates a coding error\n";
177 ownedByRegistry_ =
false;
198 return watchIndices_;
204 return watchIndices_;
void release(const bool unregister=false)
Release ownership of this object from its registry.
A class for managing temporary objects.
bool is_pointer() const noexcept
True if this is a managed pointer (not a reference)
const labelList & watchIndices() const
Return file-monitoring handles.
T * get() noexcept
Return pointer without nullptr checking.
label eventNo() const
Event number at last update.
T * get() noexcept
Return pointer without nullptr checking.
T * release() noexcept
Release ownership and return the pointer.
bool ownedByRegistry() const
Is this object owned by the registry?
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
errorManip< error > abort(error &err)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define WarningInFunction
Report a warning using Foam::Warning.
A class for managing references or pointers (no reference counting)
bool is_pointer() const noexcept
True if this is a managed pointer (not a reference)