| description | Learn more about: ComPtrRef Class | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| title | ComPtrRef Class | ||||||||||
| ms.date | 10/03/2018 | ||||||||||
| ms.topic | reference | ||||||||||
| f1_keywords |
|
||||||||||
| helpviewer_keywords |
|
||||||||||
| ms.assetid | d6bdfd20-e977-45b4-9ac1-1b8efbdb77de |
Supports the WRL infrastructure and is not intended to be used directly from your code.
template <typename T>
class ComPtrRef : public ComPtrRefBase<T>;T
A ComPtr<T> type or a type derived from it, not merely the interface represented by the ComPtr.
Represents a reference to an object of type ComPtr<T>.
| Name | Description |
|---|---|
| ComPtrRef::ComPtrRef | Initializes a new instance of the ComPtrRef class from the specified pointer to another ComPtrRef object. |
| Name | Description |
|---|---|
| ComPtrRef::GetAddressOf | Retrieves the address of a pointer to the interface represented by the current ComPtrRef object. |
| ComPtrRef::ReleaseAndGetAddressOf | Deletes the current ComPtrRef object and returns a pointer-to-a-pointer to the interface that was represented by the ComPtrRef object. |
| Name | Description |
|---|---|
| ComPtrRef::operator InterfaceType** | Deletes the current ComPtrRef object and returns a pointer-to-a-pointer to the interface that was represented by the ComPtrRef object. |
| ComPtrRef::operator T* | Returns the value of the ptr_ data member of the current ComPtrRef object. |
| ComPtrRef::operator void** | Deletes the current ComPtrRef object, casts the pointer to the interface that was represented by the ComPtrRef object as a pointer-to-pointer-to void, and then returns the cast pointer. |
| ComPtrRef::operator* | Retrieves the pointer to the interface represented by the current ComPtrRef object. |
| ComPtrRef::operator== | Indicates whether two ComPtrRef objects are equal. |
| ComPtrRef::operator!= | Indicates whether two ComPtrRef objects are not equal. |
ComPtrRefBase
ComPtrRef
Header: client.h
Namespace: Microsoft::WRL::Details
Supports the WRL infrastructure and is not intended to be used directly from your code.
ComPtrRef(
_In_opt_ T* ptr
);ptr
The underlying value of another ComPtrRef object.
Initializes a new instance of the ComPtrRef class from the specified pointer to another ComPtrRef object.
Supports the WRL infrastructure and is not intended to be used directly from your code.
InterfaceType* const * GetAddressOf() const;Address of a pointer to the interface represented by the current ComPtrRef object.
Retrieves the address of a pointer to the interface represented by the current ComPtrRef object.
Supports the WRL infrastructure and is not intended to be used directly from your code.
bool operator==(
const Details::ComPtrRef<ComPtr<T>>& a,
const Details::ComPtrRef<ComPtr<U>>& b
);
bool operator==(
const Details::ComPtrRef<ComPtr<T>>& a,
decltype(__nullptr)
);
bool operator==(
decltype(__nullptr),
const Details::ComPtrRef<ComPtr<T>>& a
);
bool operator==(
const Details::ComPtrRef<ComPtr<T>>& a,
void* b
);
bool operator==(
void* b,
const Details::ComPtrRef<ComPtr<T>>& a
);a
A reference to a ComPtrRef object.
b
A reference to another ComPtrRef object, or a pointer to an anonymous type (void*).
The first operator yields true if object a is equal to object b; otherwise, false.
The second and third operators yield true if object a is equal to nullptr; otherwise, false.
The fourth and fifth operators yield true if object a is equal to object b; otherwise, false.
Indicates whether two ComPtrRef objects are equal.
Supports the WRL infrastructure and is not intended to be used directly from your code.
bool operator!=(
const Details::ComPtrRef<ComPtr<T>>& a,
const Details::ComPtrRef<ComPtr<U>>& b
);
bool operator!=(
const Details::ComPtrRef<ComPtr<T>>& a,
decltype(__nullptr)
);
bool operator!=(
decltype(__nullptr),
const Details::ComPtrRef<ComPtr<T>>& a
);
bool operator!=(
const Details::ComPtrRef<ComPtr<T>>& a,
void* b
);
bool operator!=(
void* b,
const Details::ComPtrRef<ComPtr<T>>& a
);a
A reference to a ComPtrRef object.
b
A reference to another ComPtrRef object, or a pointer to an anonymous object (void*).
The first operator yields true if object a is not equal to object b; otherwise, false.
The second and third operators yield true if object a is not equal to nullptr; otherwise, false.
The fourth and fifth operators yield true if object a is not equal to object b; otherwise, false.
Indicates whether two ComPtrRef objects are not equal.
Supports the WRL infrastructure and is not intended to be used directly from your code.
operator InterfaceType**();Deletes the current ComPtrRef object and returns a pointer-to-a-pointer to the interface that was represented by the ComPtrRef object.
Supports the WRL infrastructure and is not intended to be used directly from your code.
InterfaceType* operator *();Pointer to the interface represented by the current ComPtrRef object.
Retrieves the pointer to the interface represented by the current ComPtrRef object.
Supports the WRL infrastructure and is not intended to be used directly from your code.
operator T*();Returns the value of the ptr_ data member of the current ComPtrRef object.
Supports the WRL infrastructure and is not intended to be used directly from your code.
operator void**() const;Deletes the current ComPtrRef object, casts the pointer to the interface that was represented by the ComPtrRef object as a pointer-to-pointer-to void, and then returns the cast pointer.
Supports the WRL infrastructure and is not intended to be used directly from your code.
InterfaceType** ReleaseAndGetAddressOf();Pointer to the interface that was represented by the deleted ComPtrRef object.
Deletes the current ComPtrRef object and returns a pointer-to-a-pointer to the interface that was represented by the ComPtrRef object.