Nameless Engine
Loading...
Searching...
No Matches
PipelineSharedPtr.h
1#pragma once
2
3// Standard.
4#include <memory>
5
6namespace ne {
7 class Pipeline;
8 class Material;
9 class ComputeShaderInterface;
10
16 public:
23 explicit PipelineSharedPtr(std::shared_ptr<Pipeline> pPipeline, Material* pMaterialThatUsesPipeline);
24
31 explicit PipelineSharedPtr(
33
35 PipelineSharedPtr() = default;
36
38
39 PipelineSharedPtr(const PipelineSharedPtr&) = delete;
40 PipelineSharedPtr& operator=(const PipelineSharedPtr&) = delete;
41
47 PipelineSharedPtr(PipelineSharedPtr&& other) noexcept;
48
56 PipelineSharedPtr& operator=(PipelineSharedPtr&& other) noexcept;
57
63 bool isInitialized() const;
64
66 void clear();
67
74 void set(std::shared_ptr<Pipeline> pPipeline, Material* pMaterialThatUsesPipeline);
75
83 inline Pipeline* getPipeline() const { return pPipeline.get(); }
84
90 Pipeline* operator->() const;
91
92 private:
95
102 void initialize(std::shared_ptr<Pipeline> pPipeline, Material* pMaterialThatUsesPipeline);
103
110 void initialize(
112
114 std::shared_ptr<Pipeline> pPipeline = nullptr;
115
122
129 };
130}
Definition: ComputeShaderInterface.h:46
Definition: Material.h:63
Definition: PipelineSharedPtr.h:15
bool isInitialized() const
Definition: PipelineSharedPtr.cpp:37
ComputeShaderInterface * pComputeShaderThatUsesPipeline
Definition: PipelineSharedPtr.h:128
void set(std::shared_ptr< Pipeline > pPipeline, Material *pMaterialThatUsesPipeline)
Definition: PipelineSharedPtr.cpp:41
void clear()
Definition: PipelineSharedPtr.cpp:39
void initialize(std::shared_ptr< Pipeline > pPipeline, Material *pMaterialThatUsesPipeline)
Definition: PipelineSharedPtr.cpp:70
Pipeline * operator->() const
Definition: PipelineSharedPtr.cpp:46
void clearPointerAndNotifyPipeline()
Definition: PipelineSharedPtr.cpp:48
PipelineSharedPtr()=default
Pipeline * getPipeline() const
Definition: PipelineSharedPtr.h:83
Material * pMaterialThatUsesPipeline
Definition: PipelineSharedPtr.h:121
std::shared_ptr< Pipeline > pPipeline
Definition: PipelineSharedPtr.h:114
Definition: Pipeline.h:20