template<typename T, void(*)(T) AddRefFn, void(*)(T) ReleaseFn>
class vtkWebGPU::Handle< T, AddRefFn, ReleaseFn >
Reference-counted owner of a WebGPU C API handle.
- Template Parameters
-
| T | the raw handle type, e.g. WGPUBuffer |
| AddRefFn | the matching wgpu<Type>AddRef function |
| ReleaseFn | the matching wgpu<Type>Release function |
Definition at line 65 of file vtkWebGPUHandle.h.
|
| | 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.
|
template<typename T, void(*)(T) AddRefFn, void(*)(T) ReleaseFn>
Adopt raw without adding a reference.
Use for handles returned by wgpu*Create* entry points, which hand back an owned reference.
Definition at line 80 of file vtkWebGPUHandle.h.
template<typename T, void(*)(T) AddRefFn, void(*)(T) ReleaseFn>
Relinquish ownership to the caller, who becomes responsible for releasing the returned handle.
This handle becomes null.
Definition at line 147 of file vtkWebGPUHandle.h.
template<typename T, void(*)(T) AddRefFn, void(*)(T) ReleaseFn>
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.