|
| vtkNew () |
| Create a new T on construction.
|
|
T * | operator-> () const noexcept |
| Enable pointer-like dereference syntax.
|
|
T & | operator* () const noexcept |
| Dereference the pointer and return a reference to the contained object.
|
|
vtkNew< T > & | operator= (vtkNew< T > &&other) noexcept |
| Move assignment operator.
|
|
|
| vtkNew (vtkNew &&o) noexcept |
| Move the object into the constructed vtkNew wrapper, stealing its reference.
|
|
template<typename U > |
| vtkNew (vtkNew< U > &&o) noexcept |
| Move the object into the constructed vtkNew wrapper, stealing its reference.
|
|
|
void | Reset () |
| Deletes reference to instance of T.
|
|
|
T * | GetPointer () const noexcept |
| Get a raw pointer to the contained object.
|
|
T * | Get () const noexcept |
| Get a raw pointer to the contained object.
|
|
| operator T* () const noexcept |
| Get a raw pointer to the contained object.
|
|
template<class T>
class vtkNew< T >
Allocate and hold a VTK object.
vtkNew is a class template that on construction allocates and initializes an instance of its template argument using T::New(). It assumes ownership of one reference during its lifetime, and calls T->Delete() on destruction.
Automatic casting to raw pointer is available for convenience, but users of this method should ensure that they do not return this pointer if the vtkNew will go out of scope without incrementing its reference count.
vtkNew is a drop in replacement for vtkSmartPointer, for example,
renWin->AddRenderer(ren);
iren->SetRenderWindow(renWin);
Allocate and hold a VTK object.
- See also
- vtkSmartPointer vtkWeakPointer
- Examples:
- vtkNew (Examples)
- Tests:
- vtkNew (Tests)
Definition at line 50 of file vtkNew.h.