description | title | ms.date | ms.topic | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: InterfaceTraits Structure |
InterfaceTraits Structure |
10/03/2018 |
reference |
|
|
ede0c284-19a7-4892-9738-ff3da4923d0a |
Supports the WRL infrastructure and is not intended to be used directly from your code.
template<typename I0>
struct __declspec(novtable) InterfaceTraits;
template<typename CloakedType>
struct __declspec(novtable) InterfaceTraits<
CloakedIid<CloakedType>
>;
template<>
struct __declspec(novtable) InterfaceTraits<Nil>;
I0
The name of an interface.
CloakedType
For RuntimeClass
, Implements
and ChainInterfaces
, an interface that won't be in the list of supported interface IDs.
Implements common characteristics of an interface.
The second template is a specialization for cloaked interfaces. The third template is a specialization for Nil parameters.
Name | Description |
---|---|
Base |
A synonym for the I0 template parameter. |
Name | Description |
---|---|
InterfaceTraits::CanCastTo | Indicates whether the specified pointer can be cast to a pointer to Base . |
InterfaceTraits::CastToBase | Casts the specified pointer to a pointer to Base . |
InterfaceTraits::CastToUnknown | Casts the specified pointer to a pointer to IUnknown . |
InterfaceTraits::FillArrayWithIid | Assigns the interface ID of Base to the array element specified by the index argument. |
InterfaceTraits::Verify | Verifies that Base is properly derived. |
Name | Description |
---|---|
InterfaceTraits::IidCount | Holds the number of interface IDs associated with the current InterfaceTraits object. |
InterfaceTraits
Header: implements.h
Namespace: Microsoft::WRL::Details
Supports the WRL infrastructure and is not intended to be used directly from your code.
template<typename T>
static __forceinline bool CanCastTo(
_In_ T* ptr,
REFIID riid,
_Deref_out_ void **ppv
);
ptr
The name of a pointer to a type.
riid
The interface ID of Base
.
ppv
If this operation is successful, ppv points to the interface specified by Base
. Otherwise, ppv is set to nullptr
.
true
if this operation is successful and ptr is cast to a pointer to Base
; otherwise, false
.
Indicates whether the specified pointer can be cast to a pointer to Base
.
For more information about Base
, see the Public Typedefs section.
Supports the WRL infrastructure and is not intended to be used directly from your code.
template<typename T>
static __forceinline Base* CastToBase(
_In_ T* ptr
);
T
The type of parameter ptr.
ptr
Pointer to a type T.
A pointer to Base
.
Casts the specified pointer to a pointer to Base
.
For more information about Base
, see the Public Typedefs section.
Supports the WRL infrastructure and is not intended to be used directly from your code.
template<typename T>
static __forceinline IUnknown* CastToUnknown(
_In_ T* ptr
);
T
The type of parameter ptr.
ptr
Pointer to type T.
Pointer to the IUnknown from which Base
is derived.
Casts the specified pointer to a pointer to IUnknown
.
For more information about Base
, see the Public Typedefs section.
Supports the WRL infrastructure and is not intended to be used directly from your code.
__forceinline static void FillArrayWithIid(
_Inout_ unsigned long &index,
_In_ IID* iids
);
index
Pointer to a field that contains a zero-based index value.
iids
An array of interface IDs.
Assigns the interface ID of Base
to the array element specified by the index argument.
Contrary to the name of this API, only one array element is modified; not the entire array.
For more information about Base
, see the Public Typedefs section.
Supports the WRL infrastructure and is not intended to be used directly from your code.
static const unsigned long IidCount = 1;
Holds the number of interface IDs associated with the current InterfaceTraits
object.
Supports the WRL infrastructure and is not intended to be used directly from your code.
__forceinline static void Verify();
Verifies that Base
is properly derived.
For more information about Base
, see the Public Typedefs section.