VTK
9.4.20241122
|
Hold a reference to a vtkObjectBase instance. More...
#include <vtkSmartPointer.h>
Inherits vtkSmartPointerBase.
Public Member Functions | |
vtkSmartPointer () noexcept | |
Initialize smart pointer to nullptr. | |
template<typename U > | |
vtkSmartPointer (vtkNew< U > &&r) noexcept | |
Move the pointer from the vtkNew smart pointer to the new vtkSmartPointer, stealing its reference and resetting the vtkNew object to nullptr. | |
template<typename U > | |
vtkSmartPointer & | operator= (const vtkNew< U > &r) |
Assign object to reference. | |
template<typename U > | |
vtkSmartPointer & | operator= (U *r) |
Assign object to reference. | |
operator T* () const noexcept | |
Get the contained pointer. | |
T & | operator* () const noexcept |
Dereference the pointer and return a reference to the contained object. | |
T * | operator-> () const noexcept |
Provides normal pointer target member access using operator ->. | |
void | TakeReference (T *t) |
Transfer ownership of one reference to the given VTK object to this smart pointer. | |
vtkSmartPointer (const vtkSmartPointer &r) | |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer. | |
template<class U > | |
vtkSmartPointer (const vtkSmartPointer< U > &r) | |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer. | |
vtkSmartPointer (vtkSmartPointer &&r) noexcept | |
Move the contents of r into this. | |
template<class U > | |
vtkSmartPointer (vtkSmartPointer< U > &&r) noexcept | |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer. | |
vtkSmartPointer (T *r) | |
Initialize smart pointer to given object. | |
template<typename U > | |
vtkSmartPointer (const vtkNew< U > &r) | |
Initialize smart pointer to given object. | |
vtkSmartPointer & | operator= (const vtkSmartPointer &r) |
Assign object to reference. | |
template<class U > | |
vtkSmartPointer & | operator= (const vtkSmartPointer< U > &r) |
Assign object to reference. | |
T * | GetPointer () const noexcept |
Get the contained pointer. | |
T * | Get () const noexcept |
Get the contained pointer. | |
Public Member Functions inherited from vtkSmartPointerBase | |
vtkSmartPointerBase () noexcept | |
Initialize smart pointer to nullptr. | |
vtkSmartPointerBase (vtkObjectBase *r) | |
Initialize smart pointer to given object. | |
vtkSmartPointerBase (const vtkSmartPointerBase &r) | |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer. | |
vtkSmartPointerBase (vtkSmartPointerBase &&r) noexcept | |
Move the pointee from r into this and reset @ r. | |
~vtkSmartPointerBase () | |
Destroy smart pointer and remove the reference to its object. | |
vtkObjectBase * | GetPointer () const noexcept |
Get the contained pointer. | |
void | Report (vtkGarbageCollector *collector, const char *desc) |
Report the reference held by the smart pointer to a collector. | |
vtkSmartPointerBase & | operator= (vtkObjectBase *r) |
Assign object to reference. | |
vtkSmartPointerBase & | operator= (const vtkSmartPointerBase &r) |
Assign object to reference. | |
Static Public Member Functions | |
static vtkSmartPointer< T > | ExtendedNew () |
Create an instance of a VTK object in a memkind extended memory space. | |
static vtkSmartPointer< T > | NewInstance (T *t) |
Create a new instance of the given VTK object. | |
static vtkSmartPointer< T > | Take (T *t) |
Transfer ownership of one reference to the given VTK object to a new smart pointer. | |
static vtkSmartPointer< T > | New () |
Create an instance of a VTK object. | |
template<class... ArgsT> | |
static vtkSmartPointer< T > | New (ArgsT &&... args) |
Create an instance of a VTK object. | |
Protected Member Functions | |
vtkSmartPointer (T *r, const NoReference &n) | |
Protected Member Functions inherited from vtkSmartPointerBase | |
vtkSmartPointerBase (vtkObjectBase *r, const NoReference &) | |
Additional Inherited Members | |
Protected Attributes inherited from vtkSmartPointerBase | |
vtkObjectBase * | Object |
Hold a reference to a vtkObjectBase instance.
vtkSmartPointer is a class template that provides automatic casting for objects held by the vtkSmartPointerBase superclass.
Definition at line 140 of file vtkSmartPointer.h.
|
inlinenoexcept |
Initialize smart pointer to nullptr.
Definition at line 167 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer.
Definition at line 178 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer.
Definition at line 184 of file vtkSmartPointer.h.
|
inlinenoexcept |
Move the contents of r into this.
Definition at line 196 of file vtkSmartPointer.h.
|
inlinenoexcept |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer.
Definition at line 202 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer to given object.
Definition at line 213 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer to given object.
Definition at line 220 of file vtkSmartPointer.h.
|
inlinenoexcept |
Move the pointer from the vtkNew smart pointer to the new vtkSmartPointer, stealing its reference and resetting the vtkNew object to nullptr.
Definition at line 232 of file vtkSmartPointer.h.
|
inlineprotected |
Definition at line 396 of file vtkSmartPointer.h.
|
inline |
Assign object to reference.
This removes any reference to an old object.
Definition at line 247 of file vtkSmartPointer.h.
|
inline |
Assign object to reference.
This removes any reference to an old object.
Definition at line 254 of file vtkSmartPointer.h.
|
inline |
Assign object to reference.
This removes any reference to an old object.
Definition at line 268 of file vtkSmartPointer.h.
|
inline |
Assign object to reference.
This adds a new reference to an old object.
Definition at line 281 of file vtkSmartPointer.h.
|
inlinenoexcept |
Get the contained pointer.
Definition at line 293 of file vtkSmartPointer.h.
|
inlinenoexcept |
Get the contained pointer.
Definition at line 294 of file vtkSmartPointer.h.
|
inlinenoexcept |
Get the contained pointer.
Definition at line 300 of file vtkSmartPointer.h.
|
inlinenoexcept |
Dereference the pointer and return a reference to the contained object.
Definition at line 306 of file vtkSmartPointer.h.
|
inlinenoexcept |
Provides normal pointer target member access using operator ->.
Definition at line 311 of file vtkSmartPointer.h.
|
inline |
Transfer ownership of one reference to the given VTK object to this smart pointer.
This does not increment the reference count of the object, but will decrement it later. The caller is effectively passing ownership of one reference to the smart pointer. This is useful for code like:
vtkSmartPointer<vtkFoo> foo; foo.TakeReference(bar->NewFoo());
The input argument may not be another smart pointer.
Definition at line 325 of file vtkSmartPointer.h.
|
inlinestatic |
Create an instance of a VTK object.
Definition at line 331 of file vtkSmartPointer.h.
|
inlinestatic |
Create an instance of a VTK object.
Definition at line 333 of file vtkSmartPointer.h.
|
inlinestatic |
Create an instance of a VTK object in a memkind extended memory space.
Note that not all vtkObjects support this yet and that VTK needs to be compiled with VTK_USE_MEMKIND to enable those that do. If not enabled, this is equivalent to calling New()
Definition at line 344 of file vtkSmartPointer.h.
|
inlinestatic |
Create a new instance of the given VTK object.
Definition at line 352 of file vtkSmartPointer.h.
|
inlinestatic |
Transfer ownership of one reference to the given VTK object to a new smart pointer.
The returned smart pointer does not increment the reference count of the object on construction but will decrement it on destruction. The caller is effectively passing ownership of one reference to the smart pointer. This is useful for code like:
vtkSmartPointer<vtkFoo> foo = vtkSmartPointer<vtkFoo>::Take(bar->NewFoo());
The input argument may not be another smart pointer.
Definition at line 370 of file vtkSmartPointer.h.