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_);
169 return "tmp<" +
word(
typeid(
T).
name()) +
'>';
188 <<
"Attempt to acquire non-const reference to const object" 212 <<
"Attempt to acquire pointer to object referred to" 213 <<
" by multiple temporaries of type " <<
typeName()
311 <<
"Attempt to cast const object to non-const for a " <<
typeName()
322 if (
isTmp() && !ptr_)
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()
const T & operator()() const
Const dereference operator.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid() const
Is this temporary object valid,.
T * operator->()
Return object pointer.
void clear() const
If object pointer points to valid object:
bool empty() const
Return true if this temporary object empty,.
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)
T * ptr() const
Return tmp pointer for reuse.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
~tmp()
Destructor: deletes temporary object when the reference count is 0.
word name(const complex &)
Return a string representation of a complex.
bool isTmp() const
Return true if this is really a temporary object.
A class for managing temporary objects.
word typeName() const
Return the type name of the tmp.
T & ref() const
Return non-const reference or generate a fatal error.
tmp(T *=0)
Store object pointer.
const T & Const(T &t)
Return the const reference of the non-const reference argument.