32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Utilities/CountedPtr.h>
242 inline const T &
ref()
const;
275 :obj_p(static_cast<T *>(0),
True), const_p(
False)
282 : obj_p(other.obj_p), const_p(other.const_p)
310 return obj_p.operator->();
315 return obj_p.operator*();
341 return (const_p || obj_p.nrefs()>1) ?
False :
True;
348 #ifndef CASACORE_NO_AUTO_TEMPLATES
349 #include <casacore/casa/Utilities/COWPtr.tcc>
const T * operator->() const
return a pointer to a const object.
Bool isReadOnly() const
returns True if the object is const, otherwise, return False.
Bool isNull() const
returns False if this contains a non-null ptr, otherwise, return True.
COWPtr()
The default constructor: used to create a null pointer which is delete-able by the destructor.
Bool makeUnique()
Return True if copied, otherwise, False.
Bool isUnique() const
returns True if the object is the only instance, otherwise, return False.
COWPtr & operator=(const COWPtr< T > &other)
assignment operator with reference semantics
COWPtr(T *obj, Bool deleteIt=True, Bool readOnly=False)
The dynamic "pointer to object" constructor: default behavior is to delete the allocated memory when ...
void setReadOnly(const T *obj)
COWPtr(const COWPtr< T > &other)
copy ctor with reference semantics
const T & operator*() const
return a reference to a const object.
void set(T *obj, Bool deleteIt=True, Bool readOnly=False)
Function used to change this instance of COWPtr.
T & rwRef()
return a readable and writable reference to this instance.
const T & ref() const
return a const reference to the object.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.