yum-archive/TaSTT-Whisper
High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
git clone https://git.yummers.dev/yum-archive/TaSTT-Whisper
8c4603c
master
1#pragma once 2#include "../utils/typeTraits.hpp" 3 4// Unlike ATL, the interface map is optional for ComLight. 5// If you won't declare a map, the object will support 2 interfaces: IUnknown, and whatever template argument was passed to ObjectRoot class. 6#define BEGIN_COM_MAP () \ 7protected: \ 8bool implQueryInterface( REFIID iid, void** ppvObject ) { 9 10#define END_COM_MAP () return false; } 11 12namespace ComLight 13{ 14namespace details 15 { 16template < typename I ,typename C > 17inline bool tryReturnInterface (REFIID iid ,C * pThis ,void ** ppvResult ) 18 { 19static_assert (pointersAssignable < IUnknown ,I > (), "Trying to implement an interface that doesn't derive from IUnknown" ); 20static_assert ( pointersAssignable < I , C > (), "Declared support for an interface, but the class doesn't implement it" ); 21if ( I :: iid () != iid ) 22return false; 23I * const result = pThis; 24result -> AddRef (); 25* ppvResult = result; 26return true; 27} 28} 29} 30 31#define COM_INTERFACE_ENTRY ( I ) if( ComLight::details::tryReturnInterface<I>( iid, this, ppvObject ) ) return true;