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

#include <ShaderCpuWriteResourceBindingUniquePtr.h>

Public Member Functions

 ShaderCpuWriteResourceBindingUniquePtr (const ShaderCpuWriteResourceBindingUniquePtr &)=delete
 
ShaderCpuWriteResourceBindingUniquePtroperator= (const ShaderCpuWriteResourceBindingUniquePtr &)=delete
 
 ShaderCpuWriteResourceBindingUniquePtr (ShaderCpuWriteResourceBindingUniquePtr &&other) noexcept
 
ShaderCpuWriteResourceBindingUniquePtroperator= (ShaderCpuWriteResourceBindingUniquePtr &&other) noexcept
 
void markAsNeedsUpdate ()
 
ShaderCpuWriteResourceBindinggetResource () const
 

Private Member Functions

 ShaderCpuWriteResourceBindingUniquePtr (ShaderCpuWriteResourceBindingManager *pManager, ShaderCpuWriteResourceBinding *pResource)
 

Private Attributes

ShaderCpuWriteResourceBindingManagerpManager = nullptr
 
ShaderCpuWriteResourceBindingpResource = nullptr
 

Friends

class ShaderCpuWriteResourceBindingManager
 

Detailed Description

Small raw pointer wrapper that acts like std::unique_ptr for shader CPU write 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

◆ ShaderCpuWriteResourceBindingUniquePtr() [1/2]

ne::ShaderCpuWriteResourceBindingUniquePtr::ShaderCpuWriteResourceBindingUniquePtr ( ShaderCpuWriteResourceBindingUniquePtr &&  other)
noexcept

Move constructor.

Parameters
otherOther object.

◆ ShaderCpuWriteResourceBindingUniquePtr() [2/2]

ne::ShaderCpuWriteResourceBindingUniquePtr::ShaderCpuWriteResourceBindingUniquePtr ( ShaderCpuWriteResourceBindingManager pManager,
ShaderCpuWriteResourceBinding pResource 
)
private

Constructs a new unique pointer.

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

Member Function Documentation

◆ getResource()

ShaderCpuWriteResourceBinding * ne::ShaderCpuWriteResourceBindingUniquePtr::getResource ( ) const
inline

Returns the underlying resource.

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

◆ markAsNeedsUpdate()

void ne::ShaderCpuWriteResourceBindingUniquePtr::markAsNeedsUpdate ( )

Marks shader resource as "needs update", this will cause resource's update callback to be called multiple times.

◆ operator=()

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

Move assignment.

Parameters
otherOther object.
Returns
Result of move assignment.

Member Data Documentation

◆ pManager

ShaderCpuWriteResourceBindingManager* ne::ShaderCpuWriteResourceBindingUniquePtr::pManager = nullptr
private

Manager that owns the resource we are pointing to.

◆ pResource

ShaderCpuWriteResourceBinding* ne::ShaderCpuWriteResourceBindingUniquePtr::pResource = nullptr
private

Resource we are pointing to.


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