14#ifndef GDCMSMARTPOINTER_H
15#define GDCMSMARTPOINTER_H
38template<
class ObjectType>
49 Pointer =
const_cast<ObjectType*
>(&p);
68 operator ObjectType * ()
const
84 ObjectType* old = Pointer;
87 if ( old ) { old->UnRegister(); }
94 ObjectType* tmp =
const_cast<ObjectType*
>(&r);
105 if(Pointer) Pointer->Register();
110 if(Pointer) Pointer->UnRegister();
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
ObjectType & operator*() const
Definition gdcmSmartPointer.h:61
SmartPointer()
Definition gdcmSmartPointer.h:42
SmartPointer & operator=(SmartPointer const &r)
Overload operator assignment.
Definition gdcmSmartPointer.h:72
SmartPointer(const SmartPointer< ObjectType > &p)
Definition gdcmSmartPointer.h:43
~SmartPointer()
Definition gdcmSmartPointer.h:52
ObjectType * operator->() const
Overload operator ->
Definition gdcmSmartPointer.h:58
SmartPointer(ObjectType *p)
Definition gdcmSmartPointer.h:45
ObjectType * GetPointer() const
Explicit function to retrieve the pointer.
Definition gdcmSmartPointer.h:99
SmartPointer(ObjectType const &p)
Definition gdcmSmartPointer.h:47