28 #ifndef CASA_PTRHOLDER_H
29 #define CASA_PTRHOLDER_H
125 operator T *()
const {
return ptr_p; }
138 PtrHolder<T> &
operator=(
const PtrHolder<T> &other);
214 {
if (ptr != itsPtr) {
delete itsPtr; itsPtr = ptr; }}
219 { T* ptr = itsPtr; itsPtr = 0;
return ptr; }
260 #ifndef CASACORE_NO_AUTO_TEMPLATES
261 #include <casacore/casa/Utilities/PtrHolder.tcc>
262 #endif //# CASACORE_NO_AUTO_TEMPLATES
T * ptr()
Release the pointer for use.
T * operator->() const
Make it possible to use -> on the pointer object.
Hold and delete pointers not deleted by object destructors.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
Hold and delete pointers not deleted by object destructors.
void reset(T *ptr)
Reset the pointer.
void clear(Bool deleteCurrentPtr=True)
Set the current pointer to null; if deletePtr is True (the default), then the current pointer is dele...
T & operator*()
Make it possible to dereference the pointer object.
bool Bool
Define the standard types used by Casacore.
SPtrHolder(T *ptr=0)
Construct an SPtrHolder from a pointer which MUST have been allocated from new, since the destructor ...
void set(T *pointer, Bool isCarray=False, Bool deleteCurrentPtr=True)
Set the pointer to a new value.
void delete_pointer_if_necessary()
PtrHolder()
The default constructor uses a null pointer.
T * ptr()
Get the pointer for use.
Bool isCArray() const
See if the pointer points to a C-array.
T * operator->() const
Make it possible to use -> on the pointer object.
const T & operator*() const
void release()
Release the pointer.
T * transfer()
Transfer ownership of the pointer.