VTK
|
Hold a reference to a vtkObjectBase instance. More...
#include <vtkSmartPointer.h>
Inherits vtkSmartPointerBase.
Public Member Functions | |
vtkSmartPointer () | |
Initialize smart pointer to nullptr. More... | |
vtkSmartPointer (T *r) | |
Initialize smart pointer to given object. More... | |
vtkSmartPointer (vtkNew< T > &r) | |
Initialize smart pointer to given object. More... | |
template<class U > | |
vtkSmartPointer (const vtkSmartPointer< U > &r) | |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer. More... | |
operator T * () const | |
Get the contained pointer. More... | |
T & | operator* () const |
Dereference the pointer and return a reference to the contained object. More... | |
T * | operator-> () const |
Provides normal pointer target member access using operator ->. More... | |
void | TakeReference (T *t) |
Transfer ownership of one reference to the given VTK object to this smart pointer. More... | |
vtkSmartPointer & | operator= (T *r) |
Assign object to reference. More... | |
vtkSmartPointer & | operator= (vtkNew< T > &r) |
Assign object to reference. More... | |
template<class U > | |
vtkSmartPointer & | operator= (const vtkSmartPointer< U > &r) |
Assign object to reference. More... | |
T * | GetPointer () const |
Get the contained pointer. More... | |
T * | Get () const |
Get the contained pointer. More... | |
Public Member Functions inherited from vtkSmartPointerBase | |
vtkSmartPointerBase () | |
Initialize smart pointer to nullptr. More... | |
vtkSmartPointerBase (vtkObjectBase *r) | |
Initialize smart pointer to given object. More... | |
vtkSmartPointerBase (const vtkSmartPointerBase &r) | |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer. More... | |
~vtkSmartPointerBase () | |
Destroy smart pointer and remove the reference to its object. More... | |
vtkObjectBase * | GetPointer () const |
Get the contained pointer. More... | |
void | Report (vtkGarbageCollector *collector, const char *desc) |
Report the reference held by the smart pointer to a collector. More... | |
vtkSmartPointerBase & | operator= (vtkObjectBase *r) |
Assign object to reference. More... | |
vtkSmartPointerBase & | operator= (const vtkSmartPointerBase &r) |
Assign object to reference. More... | |
Static Public Member Functions | |
static vtkSmartPointer< T > | New () |
Create an instance of a VTK object. More... | |
static vtkSmartPointer< T > | NewInstance (T *t) |
Create a new instance of the given VTK object. More... | |
static vtkSmartPointer< T > | Take (T *t) |
Transfer ownership of one reference to the given VTK object to a new smart pointer. More... | |
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 36 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer to nullptr.
Definition at line 43 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer to given object.
Definition at line 48 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer to given object.
Definition at line 53 of file vtkSmartPointer.h.
|
inline |
Initialize smart pointer with a new reference to the same object referenced by given smart pointer.
Definition at line 60 of file vtkSmartPointer.h.
|
inlineprotected |
Definition at line 213 of file vtkSmartPointer.h.
|
inline |
Assign object to reference.
This removes any reference to an old object.
Definition at line 68 of file vtkSmartPointer.h.
|
inline |
Assign object to reference.
This removes a reference to an old object.
Definition at line 80 of file vtkSmartPointer.h.
|
inline |
Assign object to reference.
This removes any reference to an old object.
Definition at line 93 of file vtkSmartPointer.h.
|
inline |
Get the contained pointer.
Definition at line 104 of file vtkSmartPointer.h.
|
inline |
Get the contained pointer.
Definition at line 108 of file vtkSmartPointer.h.
|
inline |
Get the contained pointer.
Definition at line 117 of file vtkSmartPointer.h.
|
inline |
Dereference the pointer and return a reference to the contained object.
Definition at line 126 of file vtkSmartPointer.h.
|
inline |
Provides normal pointer target member access using operator ->.
Definition at line 134 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 151 of file vtkSmartPointer.h.
|
inlinestatic |
Create an instance of a VTK object.
Definition at line 159 of file vtkSmartPointer.h.
|
inlinestatic |
Create a new instance of the given VTK object.
Definition at line 167 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 185 of file vtkSmartPointer.h.