Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
foray::core::ManagedResource Class Referenceabstract

Base class enforcing common interface for all classes wrapping a device resource. More...

#include <foray_managedresource.hpp>

Inheritance diagram for foray::core::ManagedResource:
foray::NoMoveDefaults foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_COMMAND_BUFFER > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_DESCRIPTOR_SET > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_BUFFER > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_IMAGE > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_SAMPLER > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_SHADER_MODULE > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_SEMAPHORE > foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_PIPELINE_LAYOUT > foray::util::ManagedVectorBuffer< foray::scene::Material > foray::as::Tlas foray::bench::DeviceBenchmark foray::core::VulkanResource< OBJECT_TYPE > foray::util::ManagedUboBase foray::util::ManagedVectorBuffer< TClass > foray::util::NoiseSource

Public Member Functions

virtual std::string_view GetTypeName () const
 Return a hint for the type of resource managed by the instantiation.
 
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
 

Static Public Member Functions

static void sPrintAllocatedResources (bool printAsWarning)
 Print a list of all registered existing resources.
 
static const std::unordered_set< ManagedResource * > * GetTotalAllocatedResources ()
 

Protected Attributes

std::string mName
 This objects custom name.
 

Detailed Description

Base class enforcing common interface for all classes wrapping a device resource.

Constructor & Destructor Documentation

◆ ManagedResource() [1/2]

foray::core::ManagedResource::ManagedResource ( )

Default constructor registers the resource.

◆ ManagedResource() [2/2]

foray::core::ManagedResource::ManagedResource ( std::string_view  name)
explicit

Registers the resource and sets its name.

◆ ~ManagedResource()

virtual foray::core::ManagedResource::~ManagedResource ( )
virtual

Unregisters the resource.

Member Function Documentation

◆ Destroy()

virtual void foray::core::ManagedResource::Destroy ( )
pure virtual

◆ Exists()

virtual bool foray::core::ManagedResource::Exists ( ) const
pure virtual

◆ GetName()

std::string_view foray::core::ManagedResource::GetName ( ) const
inline

Return a custom name for the object.

◆ GetTotalAllocatedResources()

static const std::unordered_set< ManagedResource * > * foray::core::ManagedResource::GetTotalAllocatedResources ( )
inlinestatic

◆ GetTypeName()

virtual std::string_view foray::core::ManagedResource::GetTypeName ( ) const
virtual

◆ Print()

std::string foray::core::ManagedResource::Print ( ) const

Print name and type in one string.

◆ SetName()

virtual void foray::core::ManagedResource::SetName ( std::string_view  name)
virtual

◆ sPrintAllocatedResources()

static void foray::core::ManagedResource::sPrintAllocatedResources ( bool  printAsWarning)
static

Print a list of all registered existing resources.

Parameters
printAsWarningIf true, a non-zero amount is logged as a warning

Member Data Documentation

◆ mName

std::string foray::core::ManagedResource::mName
protected

This objects custom name.


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