36 if (ptr_->count() > 1)
39 <<
"Attempt to create more than 2 tmp's referring to" 40 " the same object of type " << typeName()
54 if (tPtr && !tPtr->unique())
57 <<
"Attempted construction of a " << typeName()
58 <<
" from non-unique pointer" 68 ptr_(const_cast<
T*>(&tRef))
87 <<
"Attempted copy of a deallocated " << typeName()
129 <<
"Attempted copy of a deallocated " << typeName()
155 return (isTmp() && !ptr_);
162 return (!isTmp() || (isTmp() && ptr_));
169 return "tmp<" +
word(
typeid(
T).
name()) +
'>';
181 << typeName() <<
" deallocated" 188 <<
"Attempt to acquire non-const reference to const object" 189 <<
" from a " << typeName()
205 << typeName() <<
" deallocated" 212 <<
"Attempt to acquire pointer to object referred to" 213 <<
" by multiple temporaries of type " << typeName()
224 return ptr_->clone().ptr();
259 << typeName() <<
" deallocated" 279 << typeName() <<
" deallocated" 304 << typeName() <<
" deallocated" 311 <<
"Attempt to cast const object to non-const for a " << typeName()
322 if (isTmp() && !ptr_)
325 << typeName() <<
" deallocated" 341 <<
"Attempted copy of a deallocated " << typeName()
345 if (tPtr && !tPtr->unique())
348 <<
"Attempted assignment of a " << typeName()
349 <<
" to non-unique pointer" 370 <<
"Attempted assignment to a deallocated " << typeName()
380 <<
"Attempted assignment to a const reference to an object" 381 <<
" of type " <<
typeid(
T).
name()
void clear() const
If object pointer points to valid object:
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const T & operator()() const
Const dereference operator.
T & ref() const
Return non-const reference or generate a fatal error.
bool isTmp() const
Return true if this is really a temporary object.
T * operator->()
Return object pointer.
word typeName() const
Return the type name of the tmp.
bool valid() const
Is this temporary object valid,.
void operator=(T *)
Assignment to pointer changing this tmp to a temporary T.
A class for handling words, derived from string.
errorManip< error > abort(error &err)
~tmp()
Destructor: deletes temporary object when the reference count is 0.
word name(const complex &)
Return a string representation of a complex.
bool empty() const
Return true if this temporary object empty,.
T * ptr() const
Return tmp pointer for reuse.
A class for managing temporary objects.
tmp(T *=0)
Store object pointer.