Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
donner::gpu::HandleRef< Tag > Class Template Reference

Copyable non-owning reference to a Handle, used inside descriptor structs. More...

#include "donner/gpu/Handles.h"

Public Member Functions

 HandleRef ()=default
 Constructs a null reference.
 HandleRef (const Handle< Tag > &handle)
 Implicitly references handle.
bool isValid () const
 Returns true if this reference is non-null.
uint32_t slotIndex () const
 Resource table slot index, for backend use.
uint32_t generation () const
 Slot generation at creation time, for backend use. Zero for null references.
uint64_t deviceId () const
 Identity of the owning device, for backend use. Zero for null references.

Friends

bool operator== (const HandleRef &ref, std::nullptr_t)
 Compares against null: true if the reference is null.

Detailed Description

template<typename Tag>
class donner::gpu::HandleRef< Tag >

Copyable non-owning reference to a Handle, used inside descriptor structs.

Handles are move-only, so descriptors reference them through this identity-only view instead. The device re-validates slot, generation, and device identity when the descriptor is consumed, so a stale or foreign reference fails closed exactly like a stale or foreign handle.

Template Parameters
TagTag type identifying the resource type.

Constructor & Destructor Documentation

◆ HandleRef()

template<typename Tag>
donner::gpu::HandleRef< Tag >::HandleRef ( const Handle< Tag > & handle)
inline

Implicitly references handle.

The reference does not keep the resource alive.

Parameters
handleHandle to reference.

◆ operator==

template<typename Tag>
bool operator== ( const HandleRef< Tag > & ref,
std::nullptr_t  )
friend

Compares against null: true if the reference is null.

Parameters
refReference to test.

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