Diligent Engine  v.2.4.g
RefCntAutoPtr.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * In no event and under no legal theory, whether in tort (including negligence),
18  * contract, or otherwise, unless required by applicable law (such as deliberate
19  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
20  * liable for any damages, including any direct, indirect, special, incidental,
21  * or consequential damages of any character arising as a result of this License or
22  * out of the use or inability to use the software (including but not limited to damages
23  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
24  * all other commercial damages or losses), even if such Contributor has been advised
25  * of the possibility of such damages.
26  */
27 
28 #pragma once
29 
30 #include "../../Primitives/interface/Object.h"
31 #include "../../Platforms/interface/Atomics.hpp"
32 #include "ValidatedCast.hpp"
33 #include "RefCountedObjectImpl.hpp"
34 
35 namespace Diligent
36 {
37 
38 
39 template <typename T>
41 
42 // The main advantage of RefCntAutoPtr over the std::shared_ptr is that you can
43 // attach the same raw pointer to different smart pointers.
44 //
45 // For instance, the following code will crash since p will be released twice:
46 //
47 // auto *p = new char;
48 // std::shared_ptr<char> pTmp1(p);
49 // std::shared_ptr<char> pTmp2(p);
50 // ...
51 
52 // This code, in contrast, works perfectly fine:
53 //
54 // ObjectBase *pRawPtr(new ObjectBase);
55 // RefCntAutoPtr<ObjectBase> pSmartPtr1(pRawPtr);
56 // RefCntAutoPtr<ObjectBase> pSmartPtr2(pRawPtr);
57 // ...
58 
59 // Other advantage is that weak pointers remain valid until the
60 // object is alive, even if all smart pointers were destroyed:
61 //
62 // RefCntWeakPtr<ObjectBase> pWeakPtr(pSmartPtr1);
63 // pSmartPtr1.Release();
64 // auto pSmartPtr3 = pWeakPtr.Lock();
65 // ..
66 
67 // Weak pointers can also be attached directly to the object:
68 // RefCntWeakPtr<ObjectBase> pWeakPtr(pRawPtr);
69 //
70 
72 template <typename T>
74 {
75 public:
76  RefCntAutoPtr() noexcept {}
77 
78  explicit RefCntAutoPtr(T* pObj) noexcept :
79  m_pObject{pObj}
80  {
81  if (m_pObject)
82  m_pObject->AddRef();
83  }
84 
85  RefCntAutoPtr(IObject* pObj, const INTERFACE_ID& IID) noexcept :
86  m_pObject{nullptr}
87  {
88  if (pObj)
89  pObj->QueryInterface(IID, reinterpret_cast<IObject**>(&m_pObject));
90  }
91 
92  // Copy constructor must not be template!
93  RefCntAutoPtr(const RefCntAutoPtr& AutoPtr) noexcept :
94  m_pObject{AutoPtr.m_pObject}
95  {
96  if (m_pObject)
97  m_pObject->AddRef();
98  }
99 
100  template <typename DerivedType, typename = typename std::enable_if<std::is_base_of<T, DerivedType>::value>::type>
101  RefCntAutoPtr(const RefCntAutoPtr<DerivedType>& AutoPtr) noexcept :
102  RefCntAutoPtr<T>{AutoPtr.m_pObject}
103  {
104  }
105 
106  // Non-template move constructor
107  RefCntAutoPtr(RefCntAutoPtr&& AutoPtr) noexcept :
108  m_pObject{std::move(AutoPtr.m_pObject)}
109  {
110  //Make sure original pointer has no references to the object
111  AutoPtr.m_pObject = nullptr;
112  }
113 
114  template <typename DerivedType, typename = typename std::enable_if<std::is_base_of<T, DerivedType>::value>::type>
116  m_pObject{std::move(AutoPtr.m_pObject)}
117  {
118  //Make sure original pointer has no references to the object
119  AutoPtr.m_pObject = nullptr;
120  }
121 
123  {
124  Release();
125  }
126 
127  void swap(RefCntAutoPtr& AutoPtr) noexcept
128  {
129  std::swap(m_pObject, AutoPtr.m_pObject);
130  }
131 
132  void Attach(T* pObj) noexcept
133  {
134  Release();
135  m_pObject = pObj;
136  }
137 
138  T* Detach() noexcept
139  {
140  T* pObj = m_pObject;
141  m_pObject = nullptr;
142  return pObj;
143  }
144 
145  void Release() noexcept
146  {
147  if (m_pObject)
148  {
149  m_pObject->Release();
150  m_pObject = nullptr;
151  }
152  }
153 
154  RefCntAutoPtr& operator=(T* pObj) noexcept
155  {
156  if (m_pObject != pObj)
157  {
158  if (m_pObject)
159  m_pObject->Release();
160  m_pObject = pObj;
161  if (m_pObject)
162  m_pObject->AddRef();
163  }
164  return *this;
165  }
166 
167  RefCntAutoPtr& operator=(const RefCntAutoPtr& AutoPtr) noexcept
168  {
169  return *this = AutoPtr.m_pObject;
170  }
171 
172  template <typename DerivedType, typename = typename std::enable_if<std::is_base_of<T, DerivedType>::value>::type>
174  {
175  return *this = static_cast<T*>(AutoPtr.m_pObject);
176  }
177 
178  RefCntAutoPtr& operator=(RefCntAutoPtr&& AutoPtr) noexcept
179  {
180  if (m_pObject != AutoPtr.m_pObject)
181  Attach(AutoPtr.Detach());
182 
183  return *this;
184  }
185 
186  template <typename DerivedType, typename = typename std::enable_if<std::is_base_of<T, DerivedType>::value>::type>
188  {
189  if (m_pObject != AutoPtr.m_pObject)
190  Attach(AutoPtr.Detach());
191 
192  return *this;
193  }
194 
195  // All the access functions do not require locking reference counters pointer because if it is valid,
196  // the smart pointer holds strong reference to the object and it thus cannot be released by
197  // ohter thread
198  bool operator!() const noexcept { return m_pObject == nullptr; }
199  explicit operator bool() const noexcept { return m_pObject != nullptr; }
200  bool operator==(const RefCntAutoPtr& Ptr) const noexcept { return m_pObject == Ptr.m_pObject; }
201  bool operator!=(const RefCntAutoPtr& Ptr) const noexcept { return m_pObject != Ptr.m_pObject; }
202  bool operator<(const RefCntAutoPtr& Ptr) const noexcept { return static_cast<const T*>(*this) < static_cast<const T*>(Ptr); }
203 
204  T& operator*() noexcept { return *m_pObject; }
205  const T& operator*() const noexcept { return *m_pObject; }
206 
207  T* RawPtr() noexcept { return m_pObject; }
208  const T* RawPtr() const noexcept { return m_pObject; }
209 
210  template <typename DstType>
211  DstType* RawPtr() noexcept { return ValidatedCast<DstType>(m_pObject); }
212  template <typename DstType>
213  DstType* RawPtr() const noexcept { return ValidatedCast<DstType>(m_pObject); }
214 
215  operator T*() noexcept { return RawPtr(); }
216  operator const T*() const noexcept { return RawPtr(); }
217 
218  T* operator->() noexcept { return m_pObject; }
219  const T* operator->() const noexcept { return m_pObject; }
220 
221  template <typename InterfaceType>
223  {
224  return RefCntAutoPtr<InterfaceType>{m_pObject, IID};
225  }
226 
227 private:
228  // Note that the DoublePtrHelper is a private class, and can be created only by RefCntWeakPtr
229  // Thus if no special effort is made, the lifetime of the instances of this class cannot be
230  // longer than the lifetime of the creating object
231  template <typename DstType>
232  class DoublePtrHelper
233  {
234  public:
235  DoublePtrHelper(RefCntAutoPtr& AutoPtr) noexcept :
236  NewRawPtr{static_cast<DstType*>(AutoPtr)},
237  m_pAutoPtr{std::addressof(AutoPtr)}
238  {
239  }
240 
241  DoublePtrHelper(DoublePtrHelper&& Helper) noexcept :
242  NewRawPtr{Helper.NewRawPtr},
243  m_pAutoPtr{Helper.m_pAutoPtr}
244  {
245  Helper.m_pAutoPtr = nullptr;
246  Helper.NewRawPtr = nullptr;
247  }
248 
249  ~DoublePtrHelper()
250  {
251  if (m_pAutoPtr && *m_pAutoPtr != static_cast<T*>(NewRawPtr))
252  {
253  m_pAutoPtr->Attach(static_cast<T*>(NewRawPtr));
254  }
255  }
256 
257  DstType*& operator*() noexcept { return NewRawPtr; }
258  const DstType* operator*() const noexcept { return NewRawPtr; }
259 
260  // clang-format off
261  operator DstType**() noexcept { return &NewRawPtr; }
262  operator const DstType**() const noexcept { return &NewRawPtr; }
263  // clang-format on
264 
265  private:
266  DstType* NewRawPtr;
267  RefCntAutoPtr* m_pAutoPtr;
268 
269  // clang-format off
270  DoublePtrHelper (const DoublePtrHelper&) = delete;
271  DoublePtrHelper& operator = (const DoublePtrHelper&) = delete;
272  DoublePtrHelper& operator = (DoublePtrHelper&&) = delete;
273  // clang-format on
274  };
275 
276 public:
277  template <typename DstType, typename = typename std::enable_if<std::is_convertible<T*, DstType*>::value>::type>
278  DoublePtrHelper<DstType> DblPtr() noexcept { return DoublePtrHelper<DstType>(*this); }
279  template <typename DstType, typename = typename std::enable_if<std::is_convertible<T*, DstType*>::value>::type>
280  DoublePtrHelper<DstType> DblPtr() const noexcept { return DoublePtrHelper<DstType>(*this); }
281 
282  DoublePtrHelper<T> operator&()
283  {
284  return DblPtr<T>();
285  }
286 
287  const DoublePtrHelper<T> operator&() const
288  {
289  return DblPtr<T>();
290  }
291 
292  T** RawDblPtr() noexcept { return &m_pObject; }
293  const T** RawDblPtr() const noexcept { return &m_pObject; }
294 
295  template <typename DstType, typename = typename std::enable_if<std::is_convertible<T*, DstType*>::value>::type>
296  DstType** RawDblPtr() noexcept { return reinterpret_cast<DstType**>(&m_pObject); }
297  template <typename DstType, typename = typename std::enable_if<std::is_convertible<T*, DstType*>::value>::type>
298  DstType** RawDblPtr() const noexcept { return reinterpret_cast<DstType**>(&m_pObject); }
299 
300 private:
301  template <typename OtherType>
302  friend class RefCntAutoPtr;
303 
304  T* m_pObject = nullptr;
305 };
306 
308 template <typename T>
309 class RefCntWeakPtr
310 {
311 public:
312  explicit RefCntWeakPtr(T* pObj = nullptr) noexcept :
313  m_pRefCounters{nullptr},
314  m_pObject{pObj}
315  {
316  if (m_pObject)
317  {
318  m_pRefCounters = ValidatedCast<RefCountersImpl>(m_pObject->GetReferenceCounters());
320  }
321  }
322 
324  {
325  Release();
326  }
327 
328  RefCntWeakPtr(const RefCntWeakPtr& WeakPtr) noexcept :
329  m_pRefCounters{WeakPtr.m_pRefCounters},
330  m_pObject{WeakPtr.m_pObject}
331  {
332  if (m_pRefCounters)
334  }
335 
336  RefCntWeakPtr(RefCntWeakPtr&& WeakPtr) noexcept :
337  m_pRefCounters{std::move(WeakPtr.m_pRefCounters)},
338  m_pObject{std::move(WeakPtr.m_pObject)}
339  {
340  WeakPtr.m_pRefCounters = nullptr;
341  WeakPtr.m_pObject = nullptr;
342  }
343 
344  explicit RefCntWeakPtr(RefCntAutoPtr<T>& AutoPtr) noexcept :
345  m_pRefCounters{AutoPtr ? ValidatedCast<RefCountersImpl>(AutoPtr->GetReferenceCounters()) : nullptr},
346  m_pObject{static_cast<T*>(AutoPtr)}
347  {
348  if (m_pRefCounters)
350  }
351 
352  RefCntWeakPtr& operator=(const RefCntWeakPtr& WeakPtr) noexcept
353  {
354  if (*this == WeakPtr)
355  return *this;
356 
357  Release();
358  m_pObject = WeakPtr.m_pObject;
359  m_pRefCounters = WeakPtr.m_pRefCounters;
360  if (m_pRefCounters)
362  return *this;
363  }
364 
365  RefCntWeakPtr& operator=(T* pObj) noexcept
366  {
367  return operator=(RefCntWeakPtr(pObj));
368  }
369 
370  RefCntWeakPtr& operator=(RefCntWeakPtr&& WeakPtr) noexcept
371  {
372  if (*this == WeakPtr)
373  return *this;
374 
375  Release();
376  m_pObject = std::move(WeakPtr.m_pObject);
377  m_pRefCounters = std::move(WeakPtr.m_pRefCounters);
378  WeakPtr.m_pRefCounters = nullptr;
379  WeakPtr.m_pObject = nullptr;
380  return *this;
381  }
382 
384  {
385  Release();
386  m_pObject = static_cast<T*>(AutoPtr);
387  m_pRefCounters = m_pObject ? ValidatedCast<RefCountersImpl>(m_pObject->GetReferenceCounters()) : nullptr;
388  if (m_pRefCounters)
390  return *this;
391  }
392 
393  void Release() noexcept
394  {
395  if (m_pRefCounters)
397  m_pRefCounters = nullptr;
398  m_pObject = nullptr;
399  }
400 
404  bool IsValid() const noexcept
405  {
406  return m_pObject != nullptr && m_pRefCounters != nullptr && m_pRefCounters->GetNumStrongRefs() > 0;
407  }
408 
411  {
412  RefCntAutoPtr<T> spObj;
413  if (m_pRefCounters)
414  {
415  // Try to obtain pointer to the owner object.
416  // spOwner is only used to keep the object
417  // alive while obtaining strong reference from
418  // the raw pointer m_pObject
419  RefCntAutoPtr<IObject> spOwner;
420  m_pRefCounters->GetObject(&spOwner);
421  if (spOwner)
422  {
423  // If owner is alive, we can use our RAW pointer to
424  // create strong reference
425  spObj = m_pObject;
426  }
427  else
428  {
429  // Owner object has been destroyed. There is no reason
430  // to keep this weak reference anymore
431  Release();
432  }
433  }
434  return spObj;
435  }
436 
437  bool operator==(const RefCntWeakPtr& Ptr) const noexcept { return m_pRefCounters == Ptr.m_pRefCounters; }
438  bool operator!=(const RefCntWeakPtr& Ptr) const noexcept { return m_pRefCounters != Ptr.m_pRefCounters; }
439 
440 protected:
442  // We need to store raw pointer to object itself,
443  // because if the object is owned by another object,
444  // m_pRefCounters->GetObject( &pObj ) will return
445  // pointer to owner, which is not what we need.
447 };
448 
449 } // namespace Diligent
Diligent::RefCntWeakPtr::operator=
RefCntWeakPtr & operator=(RefCntWeakPtr &&WeakPtr) noexcept
Definition: RefCntAutoPtr.hpp:370
Diligent::RefCntAutoPtr::RefCntAutoPtr
RefCntAutoPtr(const RefCntAutoPtr< DerivedType > &AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:101
Diligent::RefCntAutoPtr::Cast
RefCntAutoPtr< InterfaceType > Cast(const INTERFACE_ID &IID) const
Definition: RefCntAutoPtr.hpp:222
Diligent::RefCntAutoPtr::operator!=
bool operator!=(const RefCntAutoPtr &Ptr) const noexcept
Definition: RefCntAutoPtr.hpp:201
Diligent::RefCntWeakPtr::Release
void Release() noexcept
Definition: RefCntAutoPtr.hpp:393
Diligent::RefCntWeakPtr::operator=
RefCntWeakPtr & operator=(RefCntAutoPtr< T > &AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:383
Diligent::RefCntWeakPtr::IsValid
bool IsValid() const noexcept
Definition: RefCntAutoPtr.hpp:404
Diligent::RefCntWeakPtr::operator=
RefCntWeakPtr & operator=(T *pObj) noexcept
Definition: RefCntAutoPtr.hpp:365
Diligent::RefCountersImpl::AddWeakRef
virtual ReferenceCounterValueType AddWeakRef() override final
Definition: RefCountedObjectImpl.hpp:77
Diligent::RefCntWeakPtr
Implementation of weak pointers.
Definition: RefCntAutoPtr.hpp:40
Diligent::IObject
Base interface for all dynamic objects in the engine.
Definition: Object.h:41
Diligent::RefCntAutoPtr::RefCntAutoPtr
RefCntAutoPtr(IObject *pObj, const INTERFACE_ID &IID) noexcept
Definition: RefCntAutoPtr.hpp:85
Diligent::RefCntAutoPtr::operator!
bool operator!() const noexcept
Definition: RefCntAutoPtr.hpp:198
Diligent::RefCntAutoPtr::RefCntAutoPtr
friend class RefCntAutoPtr
Definition: RefCntAutoPtr.hpp:302
Diligent::RefCntWeakPtr::~RefCntWeakPtr
~RefCntWeakPtr()
Definition: RefCntAutoPtr.hpp:323
Diligent::RefCountersImpl::ReleaseWeakRef
virtual ReferenceCounterValueType ReleaseWeakRef() override final
Definition: RefCountedObjectImpl.hpp:82
Diligent::RefCntAutoPtr::Release
void Release() noexcept
Definition: RefCntAutoPtr.hpp:145
Diligent::RefCntWeakPtr::operator=
RefCntWeakPtr & operator=(const RefCntWeakPtr &WeakPtr) noexcept
Definition: RefCntAutoPtr.hpp:352
ValidatedCast.hpp
Diligent::RefCntAutoPtr::operator*
const T & operator*() const noexcept
Definition: RefCntAutoPtr.hpp:205
Diligent::INTERFACE_ID
Unique interface identifier.
Definition: InterfaceID.h:37
Diligent::RefCntAutoPtr::operator=
RefCntAutoPtr & operator=(RefCntAutoPtr< DerivedType > &&AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:187
Diligent::RefCntAutoPtr::~RefCntAutoPtr
~RefCntAutoPtr()
Definition: RefCntAutoPtr.hpp:122
Diligent::RefCntAutoPtr::RawPtr
T * RawPtr() noexcept
Definition: RefCntAutoPtr.hpp:207
Diligent::RefCntAutoPtr::operator==
bool operator==(const RefCntAutoPtr &Ptr) const noexcept
Definition: RefCntAutoPtr.hpp:200
Diligent::RefCntAutoPtr::Detach
T * Detach() noexcept
Definition: RefCntAutoPtr.hpp:138
Diligent::RefCntAutoPtr::RefCntAutoPtr
RefCntAutoPtr(T *pObj) noexcept
Definition: RefCntAutoPtr.hpp:78
Diligent::RefCntAutoPtr::RawDblPtr
const T ** RawDblPtr() const noexcept
Definition: RefCntAutoPtr.hpp:293
Diligent::RefCntAutoPtr::RawPtr
DstType * RawPtr() noexcept
Definition: RefCntAutoPtr.hpp:211
Diligent::RefCntAutoPtr::RawDblPtr
DstType ** RawDblPtr() noexcept
Definition: RefCntAutoPtr.hpp:296
Diligent::RefCntAutoPtr::RefCntAutoPtr
RefCntAutoPtr(const RefCntAutoPtr &AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:93
Diligent::RefCntAutoPtr::swap
void swap(RefCntAutoPtr &AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:127
Diligent::RefCntAutoPtr::operator->
T * operator->() noexcept
Definition: RefCntAutoPtr.hpp:218
Diligent::RefCntAutoPtr
Template class that implements reference counting.
Definition: RefCntAutoPtr.hpp:73
Diligent::RefCountersImpl::GetObject
virtual void GetObject(struct IObject **ppObject) override final
Definition: RefCountedObjectImpl.hpp:154
Diligent::RefCountersImpl::GetNumStrongRefs
virtual ReferenceCounterValueType GetNumStrongRefs() const override final
Definition: RefCountedObjectImpl.hpp:205
Diligent::RefCntAutoPtr::DblPtr
DoublePtrHelper< DstType > DblPtr() const noexcept
Definition: RefCntAutoPtr.hpp:280
Diligent::RefCntAutoPtr::RawDblPtr
T ** RawDblPtr() noexcept
Definition: RefCntAutoPtr.hpp:292
Diligent::RefCntWeakPtr::m_pRefCounters
RefCountersImpl * m_pRefCounters
Definition: RefCntAutoPtr.hpp:441
Diligent::RefCntWeakPtr::RefCntWeakPtr
RefCntWeakPtr(RefCntAutoPtr< T > &AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:344
Diligent::RefCntAutoPtr::Attach
void Attach(T *pObj) noexcept
Definition: RefCntAutoPtr.hpp:132
Diligent::RefCntWeakPtr::RefCntWeakPtr
RefCntWeakPtr(T *pObj=nullptr) noexcept
Definition: RefCntAutoPtr.hpp:312
Diligent::RefCntWeakPtr::m_pObject
T * m_pObject
Definition: RefCntAutoPtr.hpp:446
Diligent::RefCntAutoPtr::RefCntAutoPtr
RefCntAutoPtr() noexcept
Definition: RefCntAutoPtr.hpp:76
Diligent::RefCountersImpl
Definition: RefCountedObjectImpl.hpp:44
Diligent::RefCntAutoPtr::RefCntAutoPtr
RefCntAutoPtr(RefCntAutoPtr &&AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:107
Diligent::RefCntAutoPtr::RawDblPtr
DstType ** RawDblPtr() const noexcept
Definition: RefCntAutoPtr.hpp:298
Diligent::RefCntAutoPtr::RefCntAutoPtr
RefCntAutoPtr(RefCntAutoPtr< DerivedType > &&AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:115
Diligent::RefCntAutoPtr::operator=
RefCntAutoPtr & operator=(T *pObj) noexcept
Definition: RefCntAutoPtr.hpp:154
Diligent::RefCntAutoPtr::operator*
T & operator*() noexcept
Definition: RefCntAutoPtr.hpp:204
Diligent::RefCntAutoPtr::operator->
const T * operator->() const noexcept
Definition: RefCntAutoPtr.hpp:219
Diligent::RefCntWeakPtr::operator==
bool operator==(const RefCntWeakPtr &Ptr) const noexcept
Definition: RefCntAutoPtr.hpp:437
Diligent::RefCntAutoPtr::operator=
RefCntAutoPtr & operator=(const RefCntAutoPtr< DerivedType > &AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:173
Diligent::RefCntAutoPtr::RawPtr
const T * RawPtr() const noexcept
Definition: RefCntAutoPtr.hpp:208
Diligent::RefCntAutoPtr::operator=
RefCntAutoPtr & operator=(const RefCntAutoPtr &AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:167
Diligent::RefCntWeakPtr::RefCntWeakPtr
RefCntWeakPtr(const RefCntWeakPtr &WeakPtr) noexcept
Definition: RefCntAutoPtr.hpp:328
Diligent::RefCntWeakPtr::operator!=
bool operator!=(const RefCntWeakPtr &Ptr) const noexcept
Definition: RefCntAutoPtr.hpp:438
Diligent::RefCntWeakPtr::Lock
RefCntAutoPtr< T > Lock()
Obtains a strong reference to the object.
Definition: RefCntAutoPtr.hpp:410
RefCountedObjectImpl.hpp
Diligent::RefCntAutoPtr::operator<
bool operator<(const RefCntAutoPtr &Ptr) const noexcept
Definition: RefCntAutoPtr.hpp:202
Diligent::RefCntAutoPtr::operator=
RefCntAutoPtr & operator=(RefCntAutoPtr &&AutoPtr) noexcept
Definition: RefCntAutoPtr.hpp:178
Diligent::RefCntWeakPtr::RefCntWeakPtr
RefCntWeakPtr(RefCntWeakPtr &&WeakPtr) noexcept
Definition: RefCntAutoPtr.hpp:336
Diligent::RefCntAutoPtr::DblPtr
DoublePtrHelper< DstType > DblPtr() noexcept
Definition: RefCntAutoPtr.hpp:278
Diligent::RefCntAutoPtr::RawPtr
DstType * RawPtr() const noexcept
Definition: RefCntAutoPtr.hpp:213
Diligent::RefCntAutoPtr::operator&
DoublePtrHelper< T > operator&()
Definition: RefCntAutoPtr.hpp:282
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::RefCntAutoPtr::operator&
const DoublePtrHelper< T > operator&() const
Definition: RefCntAutoPtr.hpp:287