Files
nearby/internal/platform/implementation/windows/generated/winrt/Microsoft.Windows.AI.Foundation.h
T
2026-01-27 23:46:02 -08:00

189 lines
7.8 KiB
C++

// 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 <typename D>
auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVector<D>::GetValues(
array_view<float> values) const {
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVector>) {
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<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVector>**)&_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 <typename D>
auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVector<D>::Size() const {
uint32_t value{};
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVector>) {
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<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVector>**)&_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 <typename D>
auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVector<
D>::VectorSpaceId() const {
winrt::guid value{};
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVector>) {
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<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVector>**)&_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 <typename D>
auto consume_Microsoft_Windows_AI_Foundation_IEmbeddingVectorFactory<
D>::CreateInstance(array_view<float const> data,
winrt::guid const& vectorSpaceID) const {
void* value{};
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVectorFactory>) {
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<D const*>(this), _winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVectorFactory>**)&_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<winrt::Microsoft::Windows::AI::Foundation::
IEmbeddingVectorFactory>**)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 <typename D>
struct produce<D, winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector>
: 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<float>(reinterpret_cast<float*>(values),
reinterpret_cast<float*>(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<uint32_t>(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<winrt::guid>(this->shim().VectorSpaceId());
return 0;
} catch (...) {
return to_hresult();
}
};
#endif
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>
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<winrt::Microsoft::Windows::AI::Foundation::EmbeddingVector>(
this->shim().CreateInstance(
array_view<float const>(
reinterpret_cast<float const*>(data),
reinterpret_cast<float const*>(data) + __dataSize),
*reinterpret_cast<winrt::guid const*>(&vectorSpaceID)));
return 0;
} catch (...) {
return to_hresult();
}
};
#endif
} // namespace winrt::impl
WINRT_EXPORT namespace winrt::Microsoft::Windows::AI::Foundation {
inline EmbeddingVector::EmbeddingVector(array_view<float const> data,
winrt::guid const& vectorSpaceID)
: EmbeddingVector(
impl::call_factory<EmbeddingVector, IEmbeddingVectorFactory>(
[&](IEmbeddingVectorFactory const& f) {
return f.CreateInstance(data, vectorSpaceID);
})) {}
}
namespace std {
#ifndef WINRT_LEAN_AND_MEAN
template <>
struct hash<winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVector>
: winrt::impl::hash_base {};
template <>
struct hash<winrt::Microsoft::Windows::AI::Foundation::IEmbeddingVectorFactory>
: winrt::impl::hash_base {};
template <>
struct hash<winrt::Microsoft::Windows::AI::Foundation::EmbeddingVector>
: winrt::impl::hash_base {};
#endif
#ifdef __cpp_lib_format
#endif
} // namespace std
#endif