46 #ifndef vtkWeakPointer_h 47 #define vtkWeakPointer_h 98 return static_cast<T*
>(this->
Object);
102 return static_cast<T*
>(this->
Object);
111 return static_cast<T*
>(this->
Object);
120 return *
static_cast<T*
>(this->
Object);
128 return static_cast<T*
>(this->
Object);
136 #if defined(__HP_aCC) || defined(__IBMCPP__) 137 # define VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(op) \ 138 bool operator op (NullPointerOnly*) const \ 140 return ::operator op (*this, 0); \ 143 class NullPointerOnly {};
145 VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(==)
146 VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(!=)
147 VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(<)
148 VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(<=)
149 VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(>)
150 VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(>=)
151 # undef VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND 162 #define VTK_WEAK_POINTER_DEFINE_OPERATOR(op) \ 165 operator op (const vtkWeakPointer<T>& l, const vtkWeakPointer<T>& r) \ 167 return (l.GetPointer() op r.GetPointer()); \ 170 inline bool operator op (T* l, const vtkWeakPointer<T>& r) \ 172 return (l op r.GetPointer()); \ 175 inline bool operator op (const vtkWeakPointer<T>& l, T* r) \ 177 return (l.GetPointer() op r); \ 189 #undef VTK_WEAK_POINTER_DEFINE_OPERATOR 195 inline ostream& operator << (ostream& os, const vtkWeakPointer<T>& p)
197 return os << static_cast<const vtkWeakPointerBase&>(p);
vtkWeakPointer()
Initialize smart pointer to nullptr.
vtkWeakPointerBase & operator=(vtkObjectBase *r)
Assign object to reference.
vtkWeakPointer(T *r)
Initialize smart pointer to given object.
T & operator*() const
Dereference the pointer and return a reference to the contained object.
vtkWeakPointer(const vtkWeakPointerBase &r)
Initialize smart pointer with the given smart pointer.
T * operator->() const
Provides normal pointer target member access using operator ->.
vtkWeakPointer & operator=(const vtkWeakPointerBase &r)
Assign object to reference.
vtkWeakPointer(T *r, const NoReference &n)
a weak reference to a vtkObject.
Non-templated superclass for vtkWeakPointer.
vtkWeakPointer & operator=(T *r)
Assign object to reference.
T * GetPointer() const
Get the contained pointer.
T * Get() const
Get the contained pointer.
#define VTK_WEAK_POINTER_DEFINE_OPERATOR(op)