Go to the documentation of this file.
65 <<
"attempted copy of a deallocated temporary"
66 <<
" of type " <<
typeid(
T).
name()
84 const_cast<tmp<T>&
>(t).ptr_ = 0;
95 <<
"attempted copy of a deallocated temporary"
96 <<
" of type " <<
typeid(
T).
name()
109 if (ptr_->okToDelete())
134 return (isTmp_ && !ptr_);
141 return (!isTmp_ || (isTmp_ && ptr_));
153 <<
"temporary of type " <<
typeid(
T).
name() <<
" deallocated"
160 ptr->resetRefCount();
192 <<
"temporary of type " <<
typeid(
T).
name() <<
" deallocated"
208 return const_cast<T&
>(ref_);
221 <<
"temporary of type " <<
typeid(
T).
name() <<
" deallocated"
249 <<
"temporary of type " <<
typeid(
T).
name() <<
" deallocated"
257 return &
const_cast<T&
>(ref_);
265 return const_cast<tmp<T>&
>(*this).operator->();
274 if (ptr_->okToDelete())
297 <<
"attempted copy of a deallocated temporary"
298 <<
" of type " <<
typeid(
T).
name()
305 <<
"attempted to assign to a const reference to constant object"
306 <<
" of type " <<
typeid(
T).
name()
T & operator()()
Dereference operator.
A class for managing temporary objects.
T * operator->()
Return object pointer.
bool isTmp() const
Return true if this is really a temporary object.
T * ptr() const
Return tmp pointer for reuse.
errorManip< error > abort(error &err)
bool valid() const
Is this temporary object valid,.
tmp(T *=0)
Store object pointer.
T * ptr_
Pointer to temporary object.
bool empty() const
Return true if this temporary object empty,.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void operator=(const tmp< T > &)
Assignment operator.
bool isTmp_
Flag for whether object is a temporary or a constant object.
~tmp()
Destructor, delete object when reference count == 0.
void clear() const
If object pointer points to valid object:
word name(const complex &)
Return a string representation of a complex.