28 #ifndef vtkSmartPointer_h
29 #define vtkSmartPointer_h
36 static T* CheckType(T* t) {
return t; }
77 return static_cast<T*
>(this->
Object);
81 return static_cast<T*
>(this->
Object);
89 return static_cast<T*
>(this->
Object);
98 return *
static_cast<T*
>(this->
Object);
106 return static_cast<T*
>(this->
Object);
160 #if defined(__HP_aCC) || defined(__IBMCPP__)
161 # define VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(op) \
162 bool operator op (NullPointerOnly*) const \
164 return ::operator op (*this, 0); \
167 class NullPointerOnly {};
169 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(==)
170 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(!=)
171 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(<)
172 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(<=)
173 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(>)
174 VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND(>=)
175 # undef VTK_SMART_POINTER_DEFINE_OPERATOR_WORKAROUND
186 #define VTK_SMART_POINTER_DEFINE_OPERATOR(op) \
189 operator op (const vtkSmartPointer<T>& l, const vtkSmartPointer<T>& r) \
191 return (l.GetPointer() op r.GetPointer()); \
194 inline bool operator op (T* l, const vtkSmartPointer<T>& r) \
196 return (l op r.GetPointer()); \
199 inline bool operator op (const vtkSmartPointer<T>& l, T* r) \
201 return (l.GetPointer() op r); \
213 #undef VTK_SMART_POINTER_DEFINE_OPERATOR
218 inline ostream& operator << (ostream& os, const vtkSmartPointer<T>& p)
220 return os << static_cast<const vtkSmartPointerBase&>(p);
static vtkSmartPointer< T > Take(T *t)
static vtkSmartPointer< T > NewInstance(T *t)
vtkSmartPointerBase & operator=(vtkObjectBase *r)
vtkSmartPointer(T *r, const NoReference &n)
vtkSmartPointer & operator=(T *r)
Hold a reference to a vtkObjectBase instance.
static vtkSmartPointer< T > New()
vtkSmartPointer & operator=(const vtkSmartPointer< U > &r)
Non-templated superclass for vtkSmartPointer.
vtkSmartPointer(const vtkSmartPointer< U > &r)
#define VTK_SMART_POINTER_DEFINE_OPERATOR(op)