// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #pragma once #ifndef WINRT_Microsoft_Windows_AI_Foundation_H #define WINRT_Microsoft_Windows_AI_Foundation_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/Microsoft.Windows.AI.h" #include "winrt/impl/Microsoft.Windows.AI.Foundation.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVector::GetValues( array_view values) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetValues(values.size(), put_abi(values))); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector>**)this; check_hresult(_winrt_abi_type->GetValues(values.size(), put_abi(values))); } } template auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVector::Size() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Size(&value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector>**)this; check_hresult(_winrt_abi_type->get_Size(&value)); } return value; } template auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVector< D>::VectorSpaceId() const { winrt::guid value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_VectorSpaceId(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector>**)this; check_hresult(_winrt_abi_type->get_VectorSpaceId(put_abi(value))); } return value; } template auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVectorFactory< D>::CreateInstance(array_view data, winrt::guid const& vectorSpaceID) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVectorFactory, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateInstance( data.size(), get_abi(data), impl::bind_in(vectorSpaceID), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateInstance( data.size(), get_abi(data), impl::bind_in(vectorSpaceID), &value)); } return winrt::Microsoft::Windows::AI::Foundation::EmbeddingVector{ value, take_ownership_from_abi}; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base< D, winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector> { int32_t __stdcall GetValues(uint32_t __valuesSize, float* values) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().GetValues( array_view(reinterpret_cast(values), reinterpret_cast(values) + __valuesSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Size(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Size()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_VectorSpaceId(winrt::guid* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().VectorSpaceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVectorFactory> : produce_base< D, winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVectorFactory> { int32_t __stdcall CreateInstance(uint32_t __dataSize, float* data, winrt::guid vectorSpaceID, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().CreateInstance( array_view( reinterpret_cast(data), reinterpret_cast(data) + __dataSize), *reinterpret_cast(&vectorSpaceID))); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::AI::Foundation { inline EmbeddingVector::EmbeddingVector(array_view data, winrt::guid const& vectorSpaceID) : EmbeddingVector( impl::call_factory( [&](IEmbeddingVectorFactory const& f) { return f.CreateInstance(data, vectorSpaceID); })) {} } namespace std { #ifndef WINRT_LEAN_AND_MEAN template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } // namespace std #endif