Nameless Engine
|
#include <PipelineSharedPtr.h>
Public Member Functions | |
PipelineSharedPtr (std::shared_ptr< Pipeline > pPipeline, Material *pMaterialThatUsesPipeline) | |
PipelineSharedPtr (std::shared_ptr< Pipeline > pPipeline, ComputeShaderInterface *pComputeShaderThatUsesPipeline) | |
PipelineSharedPtr ()=default | |
PipelineSharedPtr (const PipelineSharedPtr &)=delete | |
PipelineSharedPtr & | operator= (const PipelineSharedPtr &)=delete |
PipelineSharedPtr (PipelineSharedPtr &&other) noexcept | |
PipelineSharedPtr & | operator= (PipelineSharedPtr &&other) noexcept |
bool | isInitialized () const |
void | clear () |
void | set (std::shared_ptr< Pipeline > pPipeline, Material *pMaterialThatUsesPipeline) |
Pipeline * | getPipeline () const |
Pipeline * | operator-> () const |
Private Member Functions | |
void | clearPointerAndNotifyPipeline () |
void | initialize (std::shared_ptr< Pipeline > pPipeline, Material *pMaterialThatUsesPipeline) |
void | initialize (std::shared_ptr< Pipeline > pPipeline, ComputeShaderInterface *pComputeShaderThatUsesPipeline) |
Private Attributes | |
std::shared_ptr< Pipeline > | pPipeline = nullptr |
Material * | pMaterialThatUsesPipeline = nullptr |
ComputeShaderInterface * | pComputeShaderThatUsesPipeline = nullptr |
Small wrapper class for std::shared_ptr<Pipeline>
to do some extra work when started/stopped referencing a pipeline.
|
explicit |
Constructs a new pointer for a compute shader interface that uses a pipeline.
pPipeline | Pipeline to store. |
pComputeShaderThatUsesPipeline | Compute interface that stores this pointer. |
|
default |
Leaves the internal pointers initialized as nullptr
.
|
noexcept |
Move constructor.
other | other object. |
void ne::PipelineSharedPtr::clear | ( | ) |
Clears the pointer (sets to nullptr
).
|
private |
Clears stored shared pointer and notifies the Pipeline that we no longer reference it.
|
inline |
Returns pointer to underlying pipeline.
|
private |
Initializes internal state.
pPipeline | Pipeline to store. |
pComputeShaderThatUsesPipeline | Compute interface that stores this pointer. |
bool ne::PipelineSharedPtr::isInitialized | ( | ) | const |
Tells whether the internal pipeline was set or not.
Pipeline * ne::PipelineSharedPtr::operator-> | ( | ) | const |
Access operator.
|
noexcept |
Move assignment.
other | other object. |
|
private |
Compute shader interface that stores this pointer.
nullptr
then pMaterialThatUsesPipeline is valid.
|
private |
Material that stores this pointer.
nullptr
then pComputeShaderThatUsesPipeline is valid.
|
private |
Internally stored pipeline