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 "RefCounter.hpp" 3#include "../comLightCommon.h" 4#include "../utils/typeTraits.hpp" 5 6namespace ComLight 7{ 8// Base class of objects, implements reference counting, also a few lifetime methods. 9// The template argument is the interface you want clients to get when they ask for IID_IUnknown. By convention, that pointer defines object's identity. 10template < class I > 11class ObjectRoot :public RefCounter ,public I 12 { 13protected : 14 15inline HRESULT internalFinalConstruct () 16 { 17return S_FALSE ; 18 } 19 20inline HRESULT FinalConstruct () 21 { 22return S_FALSE ; 23 } 24 25inline void FinalRelease () { } 26 27IUnknown * getUnknown () 28 { 29 static_assert( details::pointersAssignable < IUnknown ,I > (),"The interface doesn't derive from IUnknown" ); 30return static_cast < I *> (this ); 31 } 32 33bool queryExtraInterfaces (REFIID riid ,void ** ppvObject )const 34 { 35return false; 36 } 37 38// Implement query interface with 2 entries, IUnknown and I. 39bool implQueryInterface (REFIID riid ,void ** ppvObject ) 40 { 41if (riid == I ::iid ()|| riid == IUnknown ::iid () ) 42 { 43I * const result = this ; 44result -> AddRef (); 45* ppvObject = result ; 46return true; 47 } 48return false; 49 } 50 }; 51}