Nameless Engine
Loading...
Searching...
No Matches
ne::ShaderTextureResourceBindingUniquePtr Class Reference

#include <ShaderTextureResourceBindingUniquePtr.h>

Public Member Functions

 ShaderTextureResourceBindingUniquePtr (const ShaderTextureResourceBindingUniquePtr &)=delete
 
ShaderTextureResourceBindingUniquePtroperator= (const ShaderTextureResourceBindingUniquePtr &)=delete
 
 ShaderTextureResourceBindingUniquePtr (ShaderTextureResourceBindingUniquePtr &&other) noexcept
 
ShaderTextureResourceBindingUniquePtroperator= (ShaderTextureResourceBindingUniquePtr &&other) noexcept
 
ShaderTextureResourceBindinggetResource () const
 

Private Member Functions

 ShaderTextureResourceBindingUniquePtr (ShaderTextureResourceBindingManager *pManager, ShaderTextureResourceBinding *pResource)
 

Private Attributes

ShaderTextureResourceBindingManagerpManager = nullptr
 
ShaderTextureResourceBindingpResource = nullptr
 

Friends

class ShaderTextureResourceBindingManager
 

Detailed Description

Small raw pointer wrapper that acts like std::unique_ptr for shader texture resource bindings to do some extra work when started/stopped referencing a resource.

When deleted causes the resource to be also deleted.

Constructor & Destructor Documentation

◆ ShaderTextureResourceBindingUniquePtr() [1/2]

ne::ShaderTextureResourceBindingUniquePtr::ShaderTextureResourceBindingUniquePtr ( ShaderTextureResourceBindingUniquePtr &&  other)
noexcept

Move constructor.

Parameters
otherOther object.

◆ ShaderTextureResourceBindingUniquePtr() [2/2]

ne::ShaderTextureResourceBindingUniquePtr::ShaderTextureResourceBindingUniquePtr ( ShaderTextureResourceBindingManager pManager,
ShaderTextureResourceBinding pResource 
)
private

Constructs a new unique pointer.

Parameters
pManagerManager that owns the resource.
pResourceResource to point to.

Member Function Documentation

◆ getResource()

ShaderTextureResourceBinding * ne::ShaderTextureResourceBindingUniquePtr::getResource ( ) const
inline

Returns the underlying resource.

Returns
nullptr if moved or not initialized, otherwise valid pointer to resource.

◆ operator=()

ShaderTextureResourceBindingUniquePtr & ne::ShaderTextureResourceBindingUniquePtr::operator= ( ShaderTextureResourceBindingUniquePtr &&  other)
noexcept

Move assignment.

Parameters
otherOther object.
Returns
Result of move assignment.

Member Data Documentation

◆ pManager

ShaderTextureResourceBindingManager* ne::ShaderTextureResourceBindingUniquePtr::pManager = nullptr
private

Manager that owns the resource we are pointing to.

◆ pResource

ShaderTextureResourceBinding* ne::ShaderTextureResourceBindingUniquePtr::pResource = nullptr
private

Resource we are pointing to.


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