57 ptr_ = ap().clone().
ptr();
104 <<
"object of type " <<
typeid(
T).
name()
105 <<
" already allocated" 140 <<
"object of type " <<
typeid(
T).
name()
141 <<
" is not allocated" 155 <<
"object of type " <<
typeid(
T).
name()
156 <<
" is not allocated" 170 <<
"object of type " <<
typeid(
T).
name()
171 <<
" is not allocated" 185 <<
"object of type " <<
typeid(
T).
name()
186 <<
" is not allocated" 207 <<
"object of type " <<
typeid(
T).
name()
208 <<
" is not allocated" 219 return const_cast<autoPtr<T>&
>(*this).operator->();
T & operator*()
Return reference to the object data.
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
T * ptr()
Return object pointer for reuse.
bool empty() const
Return true if the autoPtr is empty (ie, no pointer set)
void clear()
Delete object (if the pointer is valid) and set pointer to.
autoPtr(T *=nullptr)
Store object pointer.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
errorManip< error > abort(error &err)
void set(T *)
Set pointer to that given.
word name(const complex &)
Return a string representation of a complex.
void operator=(T *)
Take over the object pointer from parameter.
~autoPtr()
Destructor, delete object if pointer is not nullptr.
T * operator->()
Return object pointer.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
T & operator()()
Return reference to the object data.