template<typename T>
tp::Lifeguard class final

A lifeguard for a Vulkan handle implementing RAII by invoking specialized deleters according to the type of the handle when the lifeguard is destroyed. Can be created from an existing Vulkan handle with tp::Device::vkMakeHandleLifeguard.

Public static functions

static auto NonOwning(TypedHandle vkHandle) -> Lifeguard
Creates a non-owning tp::Lifeguard instance out of a Vulkan object handle. A non-owning handle lifeguard will not delete the Vulkan object when it is destroyed. It can be useful for passing Vulkan objects to functions that expect an owning handle.

Public functions

void destroyHandle(bool immediately = false) noexcept
Destroys the underlying handle.
auto isNonOwning() const -> bool noexcept
Returnstrue` if the handle lifeguard does not own its handle.
auto isNull() const -> bool noexcept
Returns true if the object handle is VK_NULL_HANDLE.
auto vkGetHandle() const -> TypedHandle
Returns the underlying Vulkan object handle.