nx_metadata_sdk  1.0
Metadata SDK
Public Member Functions | Protected Member Functions | List of all members
nx::sdk::Interface< DerivedInterface, BaseInterface > Class Template Reference

#include <interface.h>

Inheritance diagram for nx::sdk::Interface< DerivedInterface, BaseInterface >:

Public Member Functions

virtual IRefCountablequeryInterface (const InterfaceId *id)
 
template<class Interface >
Ptr< InterfacequeryInterface ()
 
template<class Interface >
Ptr< const InterfacequeryInterface () const
 

Protected Member Functions

virtual IRefCountablequeryInterface (const IRefCountable::InterfaceId *id) override
 
IRefCountablequeryInterfaceSupportingDeprecatedId (const IRefCountable::InterfaceId *id, const Uuid &deprecatedInterfaceId)
 

Detailed Description

template<class DerivedInterface, class BaseInterface = IRefCountable>
class nx::sdk::Interface< DerivedInterface, BaseInterface >

Helper class to define interfaces: provides the appropriate queryInterface().

Usage:

class MyInterface: public nx::sdk::Interface<MyInterface, MyBaseInterface>
{
public:
static auto interfaceId() { return makeId("my_namespace::MyInterface"); }
... // pure virtual methods
};

Member Function Documentation

◆ queryInterface()

template<class DerivedInterface, class BaseInterface = IRefCountable>
virtual IRefCountable* nx::sdk::IRefCountable::queryInterface
inline

VMT #1.

Intended to be called indirectly, via queryInterface<Interface>(), hence protected.

Returns
Object that requires releaseRef() by the caller when it no longer needs it, or null if the requested interface is not implemented.

◆ queryInterfaceSupportingDeprecatedId()

template<class DerivedInterface, class BaseInterface = IRefCountable>
IRefCountable* nx::sdk::Interface< DerivedInterface, BaseInterface >::queryInterfaceSupportingDeprecatedId ( const IRefCountable::InterfaceId id,
const Uuid deprecatedInterfaceId 
)
inlineprotected

Call from DerivedInterface::queryInterface() to support interface id from the old SDK.


The documentation for this class was generated from the following file: