Foundation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Foundation::RHI::RHIScopedHandle< Factory, T > Class Template Reference

Scoped move-only RAII handle wrapper for RHI Objects. More...

#include <Details.hpp>

Inheritance diagram for Foundation::RHI::RHIScopedHandle< Factory, T >:
Foundation::RHI::RHIHandle< Factory, T >

Public Member Functions

 RHIScopedHandle ()=default
 
 RHIScopedHandle (Factory *factory, Handle handle)
 
 RHIScopedHandle (RHIScopedHandle &&other) noexcept
 
RHIScopedHandleoperator= (RHIScopedHandle &&other) noexcept
 
RHIHandle< Factory, TView () const
 Returns a non-owning view of the underlying RHIHandle.
 
RHIHandle< Factory, TRelease ()
 Releases the underlying RHIHandle, invalidating the scoped handle. NOTE: This may leak the resource if not properly managed afterward.
 
void Reset ()
 Destructs the underlying RHIObject, and invalidates the scoped handle.
 
 RHIScopedHandle (const RHIScopedHandle &)=delete
 
RHIScopedHandleoperator= (const RHIScopedHandle &)=delete
 
 ~RHIScopedHandle ()
 
- Public Member Functions inherited from Foundation::RHI::RHIHandle< Factory, T >
template<typename U = T>
UGet () const
 Retrieves the underlying RHIObject pointer. It is undefined behavior to use the returned pointer after the underlying resource has been destroyed.
 
Toperator-> () const
 
constexpr Handle operator() () const
 
constexpr operator bool () const noexcept
 
bool operator== (const RHIHandle &other) const
 
bool IsValid () const
 Check if the handle is valid (i.e. associated with a Factory and not kInvalidHandle)
 
void Invalidate ()
 Resets the handle to an invalid state. After calling this, the handle is no longer associated with any Factory or resource.
 

Additional Inherited Members

- Public Attributes inherited from Foundation::RHI::RHIHandle< Factory, T >
FactorymFactory { nullptr }
 
Handle mHandle { kInvalidHandle }
 

Detailed Description

template<typename Factory, typename T>
class Foundation::RHI::RHIScopedHandle< Factory, T >

Scoped move-only RAII handle wrapper for RHI Objects.

Constructor & Destructor Documentation

◆ RHIScopedHandle() [1/4]

template<typename Factory , typename T >
Foundation::RHI::RHIScopedHandle< Factory, T >::RHIScopedHandle ( )
default

◆ RHIScopedHandle() [2/4]

template<typename Factory , typename T >
Foundation::RHI::RHIScopedHandle< Factory, T >::RHIScopedHandle ( Factory factory,
Handle  handle 
)
inline

◆ RHIScopedHandle() [3/4]

template<typename Factory , typename T >
Foundation::RHI::RHIScopedHandle< Factory, T >::RHIScopedHandle ( RHIScopedHandle< Factory, T > &&  other)
inlinenoexcept

◆ RHIScopedHandle() [4/4]

template<typename Factory , typename T >
Foundation::RHI::RHIScopedHandle< Factory, T >::RHIScopedHandle ( const RHIScopedHandle< Factory, T > &  )
delete

◆ ~RHIScopedHandle()

Member Function Documentation

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ Release()

Releases the underlying RHIHandle, invalidating the scoped handle. NOTE: This may leak the resource if not properly managed afterward.

◆ Reset()

Destructs the underlying RHIObject, and invalidates the scoped handle.

◆ View()

template<typename Factory , typename T >
RHIHandle< Factory, T > Foundation::RHI::RHIScopedHandle< Factory, T >::View ( ) const
inline

Returns a non-owning view of the underlying RHIHandle.


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