Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
foray::core::VulkanResource< OBJECT_TYPE > Class Template Reference

ManagedResource variant which automates GetTypeName() overloading by returning a stringified version of VkObjectType. More...

#include <foray_managedresource.hpp>

Inheritance diagram for foray::core::VulkanResource< OBJECT_TYPE >:
foray::core::ManagedResource foray::NoMoveDefaults

Public Member Functions

 VulkanResource ()
 
 VulkanResource (std::string_view name)
 
virtual std::string_view GetTypeName () const
 Returns <OBJECT_TYPE> stringified.
 
- Public Member Functions inherited from foray::core::ManagedResource
virtual bool Exists () const =0
 Return true, if the managed resource is allocated.
 
virtual void Destroy ()=0
 Destroy the resource.
 
 ManagedResource ()
 Default constructor registers the resource.
 
 ManagedResource (std::string_view name)
 Registers the resource and sets its name.
 
virtual ~ManagedResource ()
 Unregisters the resource.
 
std::string_view GetName () const
 Return a custom name for the object.
 
virtual void SetName (std::string_view name)
 Set a custom name for the object.
 
std::string Print () const
 Print name and type in one string.
 
- Public Member Functions inherited from foray::NoMoveDefaults
 NoMoveDefaults ()=default
 
 NoMoveDefaults (const NoMoveDefaults &other)=delete
 
 NoMoveDefaults (NoMoveDefaults &&other)=default
 
NoMoveDefaultsoperator= (const NoMoveDefaults &other)=delete
 

Protected Member Functions

virtual void SetObjectName (core::Context *context, const void *handle, std::string_view name, bool updateResourceName=true)
 Set the object name. Sets both ManagedResource::mName aswell as vulkan debug object name.
 

Additional Inherited Members

- Static Public Member Functions inherited from foray::core::ManagedResource
static void sPrintAllocatedResources (bool printAsWarning)
 Print a list of all registered existing resources.
 
static const std::unordered_set< ManagedResource * > * GetTotalAllocatedResources ()
 
- Protected Attributes inherited from foray::core::ManagedResource
std::string mName
 This objects custom name.
 

Detailed Description

template<VkObjectType OBJECT_TYPE>
class foray::core::VulkanResource< OBJECT_TYPE >

ManagedResource variant which automates GetTypeName() overloading by returning a stringified version of VkObjectType.

Template Parameters
OBJECT_TYPEObject type managed by the inheriting class

Constructor & Destructor Documentation

◆ VulkanResource() [1/2]

template<VkObjectType OBJECT_TYPE>
foray::core::VulkanResource< OBJECT_TYPE >::VulkanResource ( )
inline

◆ VulkanResource() [2/2]

template<VkObjectType OBJECT_TYPE>
foray::core::VulkanResource< OBJECT_TYPE >::VulkanResource ( std::string_view  name)
inlineexplicit

Member Function Documentation

◆ GetTypeName()

template<VkObjectType OBJECT_TYPE>
std::string_view foray::core::VulkanResource< OBJECT_TYPE >::GetTypeName ( ) const
inlinevirtual

Returns <OBJECT_TYPE> stringified.

Reimplemented from foray::core::ManagedResource.

Reimplemented in foray::as::Blas.

◆ SetObjectName()

template<VkObjectType OBJECT_TYPE>
void foray::core::VulkanResource< OBJECT_TYPE >::SetObjectName ( core::Context context,
const void *  handle,
std::string_view  name,
bool  updateResourceName = true 
)
inlineprotectedvirtual

Set the object name. Sets both ManagedResource::mName aswell as vulkan debug object name.

Parameters
contextRequires DispatchTable
handleObject handle
nameName
updateResourceNameIf true, sets ManagedResource::mName

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