template<typename T>
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::
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
Returns
true` if the handle lifeguard does not own its handle.- auto isNull() const -> bool noexcept
- Returns
true
if the object handle isVK_NULL_HANDLE
. - auto vkGetHandle() const -> TypedHandle
- Returns the underlying Vulkan object handle.