14 #ifndef GDCMSMARTPOINTER_H
15 #define GDCMSMARTPOINTER_H
38 template<
class ObjectType>
49 Pointer =
const_cast<ObjectType*
>(&p);
65 operator ObjectType * ()
const
81 ObjectType* old = Pointer;
84 if ( old ) { old->UnRegister(); }
91 ObjectType* tmp =
const_cast<ObjectType*
>(&r);
102 if(Pointer) Pointer->Register();
107 if(Pointer) Pointer->UnRegister();
115 #endif //GDCMSMARTPOINTER_H
ObjectType & operator*() const
Definition: gdcmSmartPointer.h:61
ObjectType * operator->() const
Overload operator ->
Definition: gdcmSmartPointer.h:58
~SmartPointer()
Definition: gdcmSmartPointer.h:52
SmartPointer(ObjectType *p)
Definition: gdcmSmartPointer.h:45
SmartPointer(const SmartPointer< ObjectType > &p)
Definition: gdcmSmartPointer.h:43
SmartPointer()
Definition: gdcmSmartPointer.h:42
Class for Smart Pointer.
Definition: gdcmObject.h:26
SmartPointer & operator=(SmartPointer const &r)
Overload operator assignment.
Definition: gdcmSmartPointer.h:69
SmartPointer(ObjectType const &p)
Definition: gdcmSmartPointer.h:47
Definition: gdcmASN1.h:20
ObjectType * GetPointer() const
Explicit function to retrieve the pointer.
Definition: gdcmSmartPointer.h:96