|
VTK
9.6.20260315
|
a weak reference to a vtkObjectBase. More...
#include <vtkWeakPtr.h>
Public Member Functions | |
| vtkWeakPtr () noexcept | |
| Default construction. | |
| vtkWeakPtr (const vtkNew< T > &r) | |
| Pointer construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr (vtkNew< U > &r) | |
| Pointer construction and assignment. | |
| vtkWeakPtr & | operator= (vtkNew< T > &r) |
| Pointer construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr & | operator= (vtkNew< U > &r) |
| Pointer construction and assignment. | |
| vtkWeakPtr (const vtkSmartPointer< T > &r) | |
| Pointer construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr (vtkSmartPointer< U > &r) | |
| Pointer construction and assignment. | |
| vtkWeakPtr & | operator= (vtkSmartPointer< T > &r) |
| Pointer construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr & | operator= (vtkSmartPointer< U > &r) |
| Pointer construction and assignment. | |
| vtkWeakPtr (const vtkWeakPtr &r)=default | |
| Copy construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr (const vtkWeakPtr< U > &r) | |
| Copy construction and assignment. | |
| vtkWeakPtr & | operator= (const vtkWeakPtr &r)=default |
| Copy construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr & | operator= (const vtkWeakPtr< U > &r) |
| Copy construction and assignment. | |
| vtkWeakPtr (vtkWeakPtr &&r) noexcept=default | |
| Move construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr (vtkWeakPtr< U > &&r) noexcept | |
| Move construction and assignment. | |
| vtkWeakPtr & | operator= (vtkWeakPtr &&r) noexcept=default |
| Move construction and assignment. | |
| template<typename U> | |
| vtkWeakPtr & | operator= (vtkWeakPtr< U > &&r) noexcept |
| Move construction and assignment. | |
| ~vtkWeakPtr () noexcept=default | |
| bool | Expired () const |
| Check whether the held object has expired or not. | |
| vtkSmartPointer< T > | Lock (vtkObjectBase *owner=nullptr) const |
| Obtain a new reference to the held object, if available. | |
| bool | owner_before (const vtkWeakPtr &r) const |
Compatibility with std::owner_less for use in comparison-based containers. | |
Friends | |
| template<typename U> | |
| class | vtkWeakPtr |
| vtkWeakPtr & | Reset (T *r) |
| Raw pointer constructors and assignment. | |
| template<typename U> | |
| vtkWeakPtr & | Reset (U *r) |
| Raw pointer constructors and assignment. | |
| static vtkWeakPtr | FromOwningRawPointer (T *r) |
| Raw pointer constructors and assignment. | |
| template<typename U> | |
| static vtkWeakPtr | FromOwningRawPointer (U *r) |
| Raw pointer constructors and assignment. | |
a weak reference to a vtkObjectBase.
A weak reference to a vtkObjectBase, which means that assigning a vtkObjectBase to the vtkWeakPtr does not affect the reference count of the vtkObjectBase.
Some time later the table may be deleted, but if it is tested for null then the weak pointer will not leave a dangling pointer.
Note that, unlike vtkWeakPointer, the pointer itself is only accessible after calling lock to avoid the situation of another thread deleting the last instance between the check and its usage inside the conditional.
Definition at line 51 of file vtkWeakPtr.h.
|
inlinenoexcept |
Default construction.
Definition at line 75 of file vtkWeakPtr.h.
|
inline |
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 87 of file vtkWeakPtr.h.
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 93 of file vtkWeakPtr.h.
|
inline |
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 111 of file vtkWeakPtr.h.
|
inline |
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 117 of file vtkWeakPtr.h.
|
default |
Copy construction and assignment.
|
inline |
Copy construction and assignment.
Definition at line 171 of file vtkWeakPtr.h.
|
defaultnoexcept |
Move construction and assignment.
|
inlinenoexcept |
Move construction and assignment.
Definition at line 192 of file vtkWeakPtr.h.
|
defaultnoexcept |
|
inline |
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 98 of file vtkWeakPtr.h.
|
inline |
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 105 of file vtkWeakPtr.h.
|
inline |
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 122 of file vtkWeakPtr.h.
|
inline |
Pointer construction and assignment.
Only vtkNew and vtkSmartPointer instance may be used with the default constructors and assignments because these classes imply that the caller has a strong ownership in the object which guarantees it will exist for at least the duration of the vtkWeakPtr constructor.
Definition at line 129 of file vtkWeakPtr.h.
|
inlinestatic |
Raw pointer constructors and assignment.
Not immediately accessible because the caller must declare that it owns a reference to the pointer so that it does not become invalid before the vtkWeakPtr is done with its construction.
Definition at line 145 of file vtkWeakPtr.h.
|
inlinestatic |
Raw pointer constructors and assignment.
Not immediately accessible because the caller must declare that it owns a reference to the pointer so that it does not become invalid before the vtkWeakPtr is done with its construction.
Definition at line 147 of file vtkWeakPtr.h.
|
inline |
Raw pointer constructors and assignment.
Not immediately accessible because the caller must declare that it owns a reference to the pointer so that it does not become invalid before the vtkWeakPtr is done with its construction.
Definition at line 151 of file vtkWeakPtr.h.
Raw pointer constructors and assignment.
Not immediately accessible because the caller must declare that it owns a reference to the pointer so that it does not become invalid before the vtkWeakPtr is done with its construction.
Definition at line 157 of file vtkWeakPtr.h.
|
default |
Copy construction and assignment.
|
inline |
Copy construction and assignment.
Definition at line 178 of file vtkWeakPtr.h.
|
defaultnoexcept |
Move construction and assignment.
|
inlinenoexcept |
Move construction and assignment.
Definition at line 199 of file vtkWeakPtr.h.
|
inline |
Check whether the held object has expired or not.
The only trustworthy result from this method is true. That is, once the pointed-to object has expired, the state will not change without modifying the vtkWeakPtr itself. Any indication of non-expiration is a point-in-time check and does not guarantee that the object will not expire between the check and any future use.
Use of Lock is required to actually get access to the pointed-to object and guarantees that it is accessible afterwards by adding a new reference.
Definition at line 224 of file vtkWeakPtr.h.
|
inline |
Obtain a new reference to the held object, if available.
If passed, the given object will be the owner of the new reference.
"It is better to ask for forgiveness than permission."
Definition at line 235 of file vtkWeakPtr.h.
|
inline |
Compatibility with std::owner_less for use in comparison-based containers.
Definition at line 272 of file vtkWeakPtr.h.
Definition at line 294 of file vtkWeakPtr.h.