|
VTK
9.7.20261002
|
#include <vtkWebGPUHandle.h>
Reference-counted owner of a WebGPU C API handle.
| T | the raw handle type, e.g. WGPUBuffer |
| Traits | a type with static AddRef(T) and Release(T) members |
Definition at line 64 of file vtkWebGPUHandle.h.
Public Member Functions | |
| Handle ()=default | |
| Handle (std::nullptr_t) | |
| A null handle. | |
| ~Handle () | |
| Handle (const Handle &other) | |
| Handle (Handle &&other) noexcept | |
| Handle & | operator= (std::nullptr_t) |
| Release whatever is held and become null. | |
| Handle & | operator= (Handle other) noexcept |
| void | Reset () |
| Release the referenced object, if any, and become null. | |
| T | Release () |
| Relinquish ownership to the caller, who becomes responsible for releasing the returned handle. | |
| operator bool () const | |
| T | Get () const |
| Access the underlying raw handle without transferring ownership. | |
| operator T () const & | |
| Access the underlying raw handle without transferring ownership. | |
| operator T () const &&=delete | |
| Deleted so that a temporary cannot silently decay to a raw handle. | |
Static Public Member Functions | |
| static Handle | Acquire (T raw) |
| Adopt raw without adding a reference. | |
| static Handle | Reference (T raw) |
| Take a new reference to raw, which stays owned by the caller. | |
|
default |
|
inline |
A null handle.
Unlike construction from a raw handle, nullptr carries no ownership question, so this one is allowed to be implicit.
Definition at line 73 of file vtkWebGPUHandle.h.
|
inline |
Definition at line 98 of file vtkWebGPUHandle.h.
|
inline |
Definition at line 100 of file vtkWebGPUHandle.h.
|
inlinenoexcept |
Definition at line 109 of file vtkWebGPUHandle.h.
|
inlinestatic |
Adopt raw without adding a reference.
Use for handles returned by wgpu*Create* entry points, which hand back an owned reference.
Definition at line 79 of file vtkWebGPUHandle.h.
|
inlinestatic |
Take a new reference to raw, which stays owned by the caller.
Definition at line 89 of file vtkWebGPUHandle.h.
|
inline |
Release whatever is held and become null.
Definition at line 117 of file vtkWebGPUHandle.h.
|
inlinenoexcept |
Definition at line 123 of file vtkWebGPUHandle.h.
|
inline |
Release the referenced object, if any, and become null.
Definition at line 134 of file vtkWebGPUHandle.h.
|
inline |
Relinquish ownership to the caller, who becomes responsible for releasing the returned handle.
This handle becomes null.
Definition at line 146 of file vtkWebGPUHandle.h.
|
inline |
Access the underlying raw handle without transferring ownership.
The implicit conversion lets a Handle be passed straight to the C API.
Definition at line 153 of file vtkWebGPUHandle.h.
|
inline |
Access the underlying raw handle without transferring ownership.
The implicit conversion lets a Handle be passed straight to the C API.
Definition at line 154 of file vtkWebGPUHandle.h.
|
delete |
Deleted so that a temporary cannot silently decay to a raw handle.
Storing the result of Handle::Acquire(...) into a raw field would release the object at the end of the statement and leave the field dangling; bind the handle to a named variable that outlives the use, or call Get()/Release() to say explicitly which lifetime is intended.
|
inlineexplicit |
Definition at line 166 of file vtkWebGPUHandle.h.