11 constexpr
ComPtr() noexcept = default;
41 ComPtr(a_other).Swap(*
this);
49 ComPtr(a_other).Swap(*
this);
55 if (
_ptr != a_other._ptr)
56 ComPtr(a_other).Swap(*
this);
64 ComPtr(a_other).Swap(*
this);
88 if (
_ptr !=
nullptr) {
89 [[maybe_unused]]
auto ref =
_ptr->Release();
90 assert((ref != 0) || (
_ptr != a_other));
146 return _ptr->QueryInterface(__uuidof(U),
reinterpret_cast<void**
>(a_ptr->ReleaseAndGetAddressOf()));
152 return _ptr->QueryInterface(a_iid,
reinterpret_cast<void**
>(a_ptr->ReleaseAndGetAddressOf()));
157 return _ptr->QueryInterface(a_iid, a_ptr);
170 return _ptr->QueryInterface(__uuidof(U),
reinterpret_cast<void**
>(a_ptr));
188 return ptr->Release();
Definition: BSDirectInputManager.h:8
std::int32_t HRESULT
Definition: BASE.h:28
Definition: ActorValueList.h:28
ComPtr & operator=(std::nullptr_t) noexcept
Definition: COMPTR.h:32
std::uint32_t Reset() noexcept
Definition: COMPTR.h:124
ComPtr & operator=(ComPtr &&a_other) noexcept
Definition: COMPTR.h:68
void Attach(T *a_other) noexcept
Definition: COMPTR.h:86
ComPtr & operator=(const ComPtr< U > &a_other) noexcept
Definition: COMPTR.h:62
ComPtr(const ComPtr &a_other) noexcept
Definition: COMPTR.h:14
T * Get() const noexcept
Definition: COMPTR.h:103
ComPtr & operator=(ComPtr< U > &&a_other) noexcept
Definition: COMPTR.h:75
HRESULT CopyTo(T **a_ptr) const noexcept
Definition: COMPTR.h:160
constexpr ComPtr() noexcept=default
void Swap(ComPtr &a_other) noexcept
Definition: COMPTR.h:129
T * operator->() const noexcept
Definition: COMPTR.h:81
T *const * GetAddressOf() const noexcept
Definition: COMPTR.h:113
T * _ptr
Definition: COMPTR.h:194
HRESULT As(ComPtr< U > *a_ptr) const noexcept
Definition: COMPTR.h:144
std::uint32_t TryRelease() noexcept
Definition: COMPTR.h:183
T ** GetAddressOf() noexcept
Definition: COMPTR.h:108
ComPtr & operator=(U *a_other) noexcept
Definition: COMPTR.h:47
HRESULT CopyTo(U **a_ptr) const noexcept
Definition: COMPTR.h:168
T * Detach() noexcept
Definition: COMPTR.h:96
ComPtr & operator=(T *a_other) noexcept
Definition: COMPTR.h:38
void TryAddRef() const noexcept
Definition: COMPTR.h:177
HRESULT AsIID(const IID &a_iid, ComPtr< U > *a_ptr) const noexcept
Definition: COMPTR.h:150
friend struct ComPtr
Definition: COMPTR.h:175
ComPtr(U *a_other) noexcept
Definition: COMPTR.h:21
void Swap(ComPtr &&a_other) noexcept
Definition: COMPTR.h:136
~ComPtr() noexcept
Definition: COMPTR.h:27
ComPtr & operator=(const ComPtr &a_other) noexcept
Definition: COMPTR.h:53
HRESULT CopyTo(const IID &a_iid, void **a_ptr) const noexcept
Definition: COMPTR.h:155
T ** ReleaseAndGetAddressOf() noexcept
Definition: COMPTR.h:118