28 #ifndef CASA_PTRHOLDER_H
29 #define CASA_PTRHOLDER_H
32 #include <casacore/casa/aips.h>
125 operator T *()
const {
return ptr_p; }
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>
Hold and delete pointers not deleted by object destructors.
T * operator->() const
Make it possible to use -> on the pointer object.
void release()
Release the pointer.
SPtrHolder(const SPtrHolder< T > &other)
SPrtHolder cannot be copied.
void reset(T *ptr)
Reset the pointer.
const T & operator*() const
T * transfer()
Transfer ownership of the pointer.
T * ptr()
Get the pointer for use.
SPtrHolder(T *ptr=0)
Construct an SPtrHolder from a pointer which MUST have been allocated from new, since the destructor ...
SPtrHolder< T > & operator=(const SPtrHolder< T > &other)
T & operator*()
Make it possible to dereference the pointer object.
PtrHolder()
The default constructor uses a null pointer.
PtrHolder(T *pointer, Bool isCArray=False)
Construct a PtrHolder from a pointer which MUST have been allocated from new, since the destructor wi...
T * ptr()
Release the pointer for use.
void set(T *pointer, Bool isCarray=False, Bool deleteCurrentPtr=True)
Set the pointer to a new value.
void clear(Bool deleteCurrentPtr=True)
Set the current pointer to null; if deletePtr is True (the default), then the current pointer is dele...
this file contains all the compiler specific defines
T * operator->() const
Make it possible to use -> on the pointer object.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
void delete_pointer_if_necessary()
Bool isCArray() const
See if the pointer points to a C-array.
bool Bool
Define the standard types used by Casacore.