43 ptr_(const_cast<
T*>(&tRef))
62 <<
"Attempted copy of a deallocated " << typeName()
91 <<
"Attempted copy of a deallocated " << typeName()
117 return (isTmp() && !ptr_);
124 return (!isTmp() || (isTmp() && ptr_));
131 return "tmpNrc<" +
word(
typeid(
T).
name()) +
'>';
143 << typeName() <<
" deallocated" 150 <<
"Attempt to acquire non-const reference to const object" 151 <<
" from a " << typeName()
167 << typeName() <<
" deallocated" 178 return ptr_->clone().ptr();
204 << typeName() <<
" deallocated" 229 << typeName() <<
" deallocated" 236 <<
"Attempt to cast const object to non-const for a " << typeName()
247 if (isTmp() && !ptr_)
250 << typeName() <<
" deallocated" 266 <<
"Attempted copy of a deallocated " << typeName()
297 <<
"Attempted assignment to a const reference to an object" 298 <<
" of type " <<
typeid(
T).
name()
T * ptr() const
Return tmpNrc pointer for reuse.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
~tmpNrc()
Destructor: deletes temporary object when the reference count is 0.
T & ref()
Return non-const reference or generate a fatal error.
bool valid() const
Is this temporary object valid,.
void clear() const
If object pointer points to valid object:
bool empty() const
Return true if this temporary object empty,.
A class for handling words, derived from string.
bool isTmp() const
Return true if this is really a temporary object.
errorManip< error > abort(error &err)
word typeName() const
Return the type name of the tmpNrc.
word name(const complex &)
Return a string representation of a complex.
A class for managing temporary objects without reference counting.
T * operator->()
Return object pointer.
void operator=(T *)
Assignment to pointer changing this tmpNrc to a temporary T.
const T & operator()() const
Const dereference operator.
tmpNrc(T *=0)
Store object pointer.