153 #include <type_traits>
155 VTK_ABI_NAMESPACE_BEGIN
162 template <
typename U>
164 template <
typename U>
166 template <
typename U>
173 template <
typename U = T>
174 static void CheckTypes() noexcept
177 "vtkNew<T>'s T type has not been defined. Missing include?");
179 "Cannot store an object with undefined type in "
180 "vtkNew. Missing include?");
182 "Argument type is not compatible with vtkNew<T>'s "
185 "vtkNew can only be used with subclasses of vtkObjectBase.");
195 vtkNew::CheckTypes();
209 template <
typename U>
213 vtkNew::CheckTypes<U>();
251 operator T*()
const noexcept {
return static_cast<T*
>(this->
Object); }
267 this->
Object = other.Object;
268 other.Object =
nullptr;
278 VTK_ABI_NAMESPACE_END
Allocate and hold a VTK object.
void Reset()
Deletes reference to instance of T.
T & operator*() const noexcept
Dereference the pointer and return a reference to the contained object.
vtkNew()
Create a new T on construction.
T * Get() const noexcept
Get a raw pointer to the contained object.
vtkNew(vtkNew &&o) noexcept
Move the object into the constructed vtkNew wrapper, stealing its reference.
T * GetPointer() const noexcept
Get a raw pointer to the contained object.
~vtkNew()
Deletes reference to instance of T.
vtkNew(vtkNew< U > &&o) noexcept
Move the object into the constructed vtkNew wrapper, stealing its reference.
vtkNew< T > & operator=(vtkNew< T > &&other) noexcept
Move assignment operator.
T * operator->() const noexcept
Enable pointer-like dereference syntax.
abstract base class for most VTK objects
virtual void Delete()
Delete a VTK object.
Hold a reference to a vtkObjectBase instance.
a weak reference to a vtkObject.