29 #ifndef vtkSmartPointer_h 30 #define vtkSmartPointer_h 38 static T* CheckType(T* t) {
return t; }
106 return static_cast<T*
>(this->
Object);
110 return static_cast<T*
>(this->
Object);
119 return static_cast<T*
>(this->
Object);
128 return *
static_cast<T*
>(this->
Object);
136 return static_cast<T*
>(this->
Object);
195 #if defined(__HP_aCC) || defined(__IBMCPP__) 196 # define VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(op) \ 197 bool operator op (NullPointerOnly*) const \ 199 return ::operator op (*this, 0); \ 202 class NullPointerOnly {};
204 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(==)
205 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(!=)
206 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(<)
207 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(<=)
208 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(>)
209 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(>=)
210 # undef VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND 221 #define VTK_SMART_POINTER_DEFINE_OPERATOR(op) \ 224 operator op (const vtkSmartPointer<T>& l, const vtkSmartPointer<T>& r) \ 226 return (l.GetPointer() op r.GetPointer()); \ 229 inline bool operator op (T* l, const vtkSmartPointer<T>& r) \ 231 return (l op r.GetPointer()); \ 234 inline bool operator op (const vtkSmartPointer<T>& l, T* r) \ 236 return (l.GetPointer() op r); \ 248 #undef VTK_SMART_POINTER_DEFINE_OPERATOR 254 inline ostream& operator << (ostream& os, const vtkSmartPointer<T>& p)
256 return os << static_cast<const vtkSmartPointerBase&>(p);
vtkSmartPointer()
Initialize smart pointer to nullptr.
static vtkSmartPointer< T > Take(T *t)
Transfer ownership of one reference to the given VTK object to a new smart pointer.
static vtkSmartPointer< T > NewInstance(T *t)
Create a new instance of the given VTK object.
vtkSmartPointerBase & operator=(vtkObjectBase *r)
Assign object to reference.
vtkSmartPointer(T *r, const NoReference &n)
vtkSmartPointer & operator=(T *r)
Assign object to reference.
Hold a reference to a vtkObjectBase instance.
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
vtkSmartPointer & operator=(const vtkSmartPointer< U > &r)
Assign object to reference.
vtkSmartPointer(T *r)
Initialize smart pointer to given object.
vtkSmartPointer(vtkNew< T > &r)
Initialize smart pointer to given object.
vtkSmartPointer & operator=(vtkNew< T > &r)
Assign object to reference.
Non-templated superclass for vtkSmartPointer.
void TakeReference(T *t)
Transfer ownership of one reference to the given VTK object to this smart pointer.
T * operator->() const
Provides normal pointer target member access using operator ->.
Allocate and hold a VTK object.
T * GetPointer() const
Get the contained pointer.
vtkSmartPointer(const vtkSmartPointer< U > &r)
Initialize smart pointer with a new reference to the same object referenced by given smart pointer...
T & operator*() const
Dereference the pointer and return a reference to the contained object.
#define VTK_SMART_POINTER_DEFINE_OPERATOR(op)
T * Get() const
Get the contained pointer.