LiteFX 0.5.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::ResourceAllocationResult Struct Referencefinal

Stores the result of a resource allocation. More...

#include <rendering_api.hpp>

Public Member Functions

 ResourceAllocationResult (SharedPtr< IImage > &&image) noexcept
 Initializes an allocation result for an image resource.
 
 ResourceAllocationResult (SharedPtr< IBuffer > &&buffer) noexcept
 Initializes an allocation result for a buffer resource.
 
 ResourceAllocationResult ()=delete
 
 ResourceAllocationResult (const ResourceAllocationResult &)=delete
 
 ResourceAllocationResult (ResourceAllocationResult &&) noexcept=default
 
ResourceAllocationResultoperator= (const ResourceAllocationResult &)=delete
 
ResourceAllocationResultoperator= (ResourceAllocationResult &&) noexcept=default
 
 ~ResourceAllocationResult () noexcept=default
 
template<std::derived_from< IImage > TImage>
SharedPtr< TImage > image () const
 Returns the allocated image resource, or raises an exception if the allocation does not contain an image resource, or the image resource is not of TImage .
 
template<std::derived_from< IBuffer > TBuffer>
SharedPtr< TBuffer > buffer () const
 Returns the allocated buffer resource, or raises an exception if the allocation does not contain a buffer resource, or the buffer resource is not of TBuffer .
 

Detailed Description

Stores the result of a resource allocation.

See also
IGraphicsFactory, ResourceAllocationInfo

Constructor & Destructor Documentation

◆ ResourceAllocationResult() [1/5]

LiteFX::Rendering::ResourceAllocationResult::ResourceAllocationResult ( SharedPtr< IImage > && image)
inlinenoexcept

Initializes an allocation result for an image resource.

Parameters
imageThe allocate image resource.

◆ ResourceAllocationResult() [2/5]

LiteFX::Rendering::ResourceAllocationResult::ResourceAllocationResult ( SharedPtr< IBuffer > && buffer)
inlinenoexcept

Initializes an allocation result for a buffer resource.

Parameters
bufferThe allocated buffer resource.

◆ ResourceAllocationResult() [3/5]

LiteFX::Rendering::ResourceAllocationResult::ResourceAllocationResult ( )
delete

◆ ResourceAllocationResult() [4/5]

LiteFX::Rendering::ResourceAllocationResult::ResourceAllocationResult ( const ResourceAllocationResult & )
delete

◆ ResourceAllocationResult() [5/5]

LiteFX::Rendering::ResourceAllocationResult::ResourceAllocationResult ( ResourceAllocationResult && )
defaultnoexcept

◆ ~ResourceAllocationResult()

LiteFX::Rendering::ResourceAllocationResult::~ResourceAllocationResult ( )
defaultnoexcept

Member Function Documentation

◆ buffer()

template<std::derived_from< IBuffer > TBuffer>
SharedPtr< TBuffer > LiteFX::Rendering::ResourceAllocationResult::buffer ( ) const
inline

Returns the allocated buffer resource, or raises an exception if the allocation does not contain a buffer resource, or the buffer resource is not of TBuffer .

Template Parameters
TBufferThe type of the buffer.
Returns
The pointer to the buffer resource.
Exceptions
RuntimeExceptionThrown, if the allocated resource is not a buffer, or if the allocated buffer does not implement TBuffer .

◆ image()

template<std::derived_from< IImage > TImage>
SharedPtr< TImage > LiteFX::Rendering::ResourceAllocationResult::image ( ) const
inline

Returns the allocated image resource, or raises an exception if the allocation does not contain an image resource, or the image resource is not of TImage .

Template Parameters
TImageThe type of the image.
Returns
The pointer to the image resource.
Exceptions
RuntimeExceptionThrown, if the allocated resource is not an image, or if the allocated image does not implement TImage .

◆ operator=() [1/2]

ResourceAllocationResult & LiteFX::Rendering::ResourceAllocationResult::operator= ( const ResourceAllocationResult & )
delete

◆ operator=() [2/2]

ResourceAllocationResult & LiteFX::Rendering::ResourceAllocationResult::operator= ( ResourceAllocationResult && )
defaultnoexcept