Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::geode::ScopedWgpuHandle< Handle > Class Template Reference

Move-only RAII owner for a single WebGPU handle. More...

#include "donner/svg/renderer/geode/GeodeWgpuUtil.h"

Public Member Functions

 ScopedWgpuHandle ()=default
 Construct an empty scoped handle.
 ScopedWgpuHandle (Handle handle)
 Take ownership of an existing +1 handle.
 ~ScopedWgpuHandle ()
 Release the owned handle, if any.
 ScopedWgpuHandle (const ScopedWgpuHandle &)=delete
ScopedWgpuHandleoperator= (const ScopedWgpuHandle &)=delete
 ScopedWgpuHandle (ScopedWgpuHandle &&other) noexcept
 Move ownership from another scoped handle.
ScopedWgpuHandleoperator= (ScopedWgpuHandle &&other) noexcept
 Release the current handle and move ownership from another scoped handle.
const Handle & get () const noexcept
 Return the owned handle.
Handle & get () noexcept
 Return the owned handle.
 operator bool () const noexcept
 True when a non-null handle is owned.
void reset (Handle handle=Handle()) noexcept
 Release the current handle and optionally take ownership of a replacement.
Handle take () noexcept
 Return the owned handle without releasing it.

Static Public Member Functions

static uint64_t releaseCountForTesting () noexcept
 Number of non-null handles released by this scoped-handle specialization.

Detailed Description

template<typename Handle>
class donner::geode::ScopedWgpuHandle< Handle >

Move-only RAII owner for a single WebGPU handle.

Template Parameters
HandleA wgpu:: handle type with operator bool() and release().

The vendored webgpu.hpp wrapper is a thin typed wrapper over raw C handles: copying it does not retain, and destroying it does not release. Use this type when Donner owns a +1 reference from a WebGPU create/acquire call. Borrowed handles should remain plain wgpu:: values.


The documentation for this class was generated from the following file: