| 71 | /// </summary> |
| 72 | template<typename T> |
| 73 | API_CLASS(InBuild) class WeakAssetReference : public WeakAssetReferenceBase |
| 74 | { |
| 75 | public: |
| 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 | |