Uredi

Deli z drugimi prek


Implements Structure

Implements QueryInterface and GetIid for the specified interfaces.

Syntax

template <
    typename I0,
    typename I1 = Details::Nil,
    typename I2 = Details::Nil,
    typename I3 = Details::Nil,
    typename I4 = Details::Nil,
    typename I5 = Details::Nil,
    typename I6 = Details::Nil,
    typename I7 = Details::Nil,
    typename I8 = Details::Nil,
    typename I9 = Details::Nil
>
struct __declspec(novtable) Implements :
    Details::ImplementsHelper<
        RuntimeClassFlags<WinRt>,
        typename Details::InterfaceListHelper<
            I0, I1, I2, I3, I4, I5, I6, I7, I8, I9
        >::TypeT
    >,
    Details::ImplementsBase;

template <
    int flags,
    typename I0,
    typename I1,
    typename I2,
    typename I3,
    typename I4,
    typename I5,
    typename I6,
    typename I7,
    typename I8
>
struct __declspec(novtable) Implements<
        RuntimeClassFlags<flags>,
        I0, I1, I2, I3, I4, I5, I6, I7, I8> :
    Details::ImplementsHelper<
        RuntimeClassFlags<flags>,
        typename Details::InterfaceListHelper<
            I0, I1, I2, I3, I4, I5, I6, I7, I8
        >::TypeT
    >,
    Details::ImplementsBase;

Parameters

I0
The zeroth interface ID. (Mandatory)

I1
The first interface ID. (Optional)

I2
The second interface ID. (Optional)

I3
The third interface ID. (Optional)

I4
The fourth interface ID. (Optional)

I5
The fifth interface ID. (Optional)

I6
The sixth interface ID. (Optional)

I7
The seventh interface ID. (Optional)

I8
The eighth interface ID. (Optional)

I9
The ninth interface ID. (Optional)

flags
Configuration flags for the class. One or more RuntimeClassType enumerations that are specified in a RuntimeClassFlags structure.

Remarks

Derives from the list of specified interfaces and implements helper templates for QueryInterface and GetIid.

Each I0 through I9 interface parameter must derive from either IUnknown, IInspectable, or the ChainInterfaces template. The flags parameter determines whether support is generated for IUnknown or IInspectable.

Members

Public Typedefs

Name Description
ClassFlags A synonym for RuntimeClassFlags<WinRt>.

Protected Methods

Name Description
Implements::CanCastTo Gets a pointer to the specified interface.
Implements::CastToUnknown Gets a pointer to the underlying IUnknown interface.
Implements::FillArrayWithIid Inserts the interface ID specified by the current zeroth template parameter into the specified array element.

Protected Constants

Name Description
Implements::IidCount Holds the number of implemented interface IDs.

Inheritance Hierarchy

I0

ChainInterfaces

I0

ImplementsBase

ImplementsHelper

Implements

Requirements

Header: implements.h

Namespace: Microsoft::WRL

Implements::CanCastTo

Gets a pointer to the specified interface.

__forceinline HRESULT CanCastTo(
   REFIID riid,
   _Deref_out_ void **ppv
);

Parameters

riid
A reference to an interface ID.

ppv
If successful, a pointer to the interface specified by riid.

Return Value

S_OK if successful; otherwise, an HRESULT that indicates the error, such as E_NOINTERFACE.

Remarks

This is an internal helper function that performs a QueryInterface operation.

Implements::CastToUnknown

Gets a pointer to the underlying IUnknown interface.

__forceinline IUnknown* CastToUnknown();

Return Value

This operation always succeeds and returns the IUnknown pointer.

Remarks

Internal helper function.

Implements::FillArrayWithIid

Inserts the interface ID specified by the current zeroth template parameter into the specified array element.

__forceinline static void FillArrayWithIid(
   unsigned long &index,
   _In_ IID* iids
);

Parameters

index
A zero-based index that indicates the starting array element for this operation. When this operation completes, index is incremented by 1.

iids
An array of type IID.

Remarks

Internal helper function.

Implements::IidCount

Holds the number of implemented interface IDs.

static const unsigned long IidCount;