MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / WeakAssetReference

Class WeakAssetReference

Source/Engine/Content/WeakAssetReference.h:73–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71/// </summary>
72template<typename T>
73API_CLASS(InBuild) class WeakAssetReference : public WeakAssetReferenceBase
74{
75public:
76 /// <summary>
77 /// Initializes a new instance of the <see cref="WeakAssetReference"/> class.
78 /// </summary>
79 WeakAssetReference()
80 {
81 }
82
83 /// <summary>
84 /// Initializes a new instance of the <see cref="WeakAssetReference"/> class.
85 /// </summary>
86 explicit WeakAssetReference(decltype(__nullptr))
87 {
88 }
89
90 /// <summary>
91 /// Initializes a new instance of the <see cref="WeakAssetReference"/> class.
92 /// </summary>
93 /// <param name="asset">The asset to set.</param>
94 WeakAssetReference(T* asset)
95 {
96 OnSet(asset);
97 }
98
99 /// <summary>
100 /// Initializes a new instance of the <see cref="WeakAssetReference"/> class.
101 /// </summary>
102 /// <param name="other">The other.</param>
103 WeakAssetReference(const WeakAssetReference& other)
104 {
105 OnSet(other.Get());
106 }
107
108 WeakAssetReference(WeakAssetReference&& other)
109 {
110 OnSet(other.Get());
111 other.OnSet(nullptr);
112 }
113
114 WeakAssetReference& operator=(WeakAssetReference&& other)
115 {
116 if (&other != this)
117 {
118 OnSet(other.Get());
119 other.OnSet(nullptr);
120 }
121 return *this;
122 }
123
124 /// <summary>
125 /// Finalizes an instance of the <see cref="WeakAssetReference"/> class.
126 /// </summary>
127 ~WeakAssetReference()
128 {
129 }
130

Callers

nothing calls this directly

Calls 4

OnSetFunction · 0.85
LoadAssetFunction · 0.85
GetMethod · 0.45
OnSetMethod · 0.45

Tested by

no test coverage detected