 |
VTK
9.1.0
|
Go to the documentation of this file.
159 #include <type_traits>
167 template <
typename U>
169 template <
typename U>
171 template <
typename U>
178 template <
typename U = T>
179 static void CheckTypes() noexcept
182 "vtkNew<T>'s T type has not been defined. Missing include?");
184 "Cannot store an object with undefined type in "
185 "vtkNew. Missing include?");
187 "Argument type is not compatible with vtkNew<T>'s "
190 "vtkNew can only be used with subclasses of vtkObjectBase.");
200 vtkNew::CheckTypes();
214 template <
typename U>
218 vtkNew::CheckTypes<U>();
232 T* obj = this->Object;
235 this->Object =
nullptr;
255 T*
Get() const noexcept {
return this->Object; }
256 operator T*()
const noexcept {
return static_cast<T*
>(this->Object); }
264 T&
operator*() const noexcept {
return *
static_cast<T*
>(this->Object); }
vtkWeakPointer & operator=(const vtkWeakPointer &r)
Assign object to reference.
vtkNew(vtkNew &&o) noexcept
Move the object into the constructed vtkNew wrapper, stealing its reference.
Hold a reference to a vtkObjectBase instance.
T * Get() const noexcept
Get a raw pointer to the contained object.
T * GetPointer() const noexcept
Get a raw pointer to the contained object.
T & operator*() const noexcept
Dereference the pointer and return a reference to the contained object.
abstract base class for most VTK objects
~vtkNew()
Deletes reference to instance of T.
T * operator->() const noexcept
Enable pointer-like dereference syntax.
vtkNew(vtkNew< U > &&o) noexcept
Move the object into the constructed vtkNew wrapper, stealing its reference.
Allocate and hold a VTK object.
vtkNew()
Create a new T on construction.
void Reset()
Deletes reference to instance of T.
a weak reference to a vtkObject.