mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
189 lines
7.8 KiB
C++
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_SemanticSearch_H
|
|
#define WINRT_Microsoft_Windows_SemanticSearch_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/impl/Microsoft.Windows.SemanticSearch.2.h"
|
|
namespace winrt::impl {
|
|
template <typename D>
|
|
auto consume_Microsoft_Windows_SemanticSearch_IEmbeddingVector<D>::GetValues(
|
|
array_view<float> values) const {
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::SemanticSearch::
|
|
IEmbeddingVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::Windows::SemanticSearch::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::SemanticSearch::
|
|
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::SemanticSearch::IEmbeddingVector>**)this;
|
|
check_hresult(_winrt_abi_type->GetValues(values.size(), put_abi(values)));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_Windows_SemanticSearch_IEmbeddingVector<D>::Count()
|
|
const {
|
|
uint32_t value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::SemanticSearch::
|
|
IEmbeddingVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::Windows::SemanticSearch::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::SemanticSearch::
|
|
IEmbeddingVector>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_Count(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<
|
|
winrt::Microsoft::Windows::SemanticSearch::IEmbeddingVector>**)this;
|
|
check_hresult(_winrt_abi_type->get_Count(&value));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_Windows_SemanticSearch_IEmbeddingVector<
|
|
D>::VectorSpaceId() const {
|
|
winrt::guid value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::SemanticSearch::
|
|
IEmbeddingVector>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::Windows::SemanticSearch::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::SemanticSearch::
|
|
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::SemanticSearch::IEmbeddingVector>**)this;
|
|
check_hresult(_winrt_abi_type->get_VectorSpaceId(put_abi(value)));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_Windows_SemanticSearch_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::SemanticSearch::
|
|
IEmbeddingVectorFactory>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result = impl::try_as_with_reason<
|
|
winrt::Microsoft::Windows::SemanticSearch::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::SemanticSearch::
|
|
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::SemanticSearch::
|
|
IEmbeddingVectorFactory>**)this;
|
|
check_hresult(_winrt_abi_type->CreateInstance(
|
|
data.size(), get_abi(data), impl::bind_in(vectorSpaceID), &value));
|
|
}
|
|
return winrt::Microsoft::Windows::SemanticSearch::EmbeddingVector{
|
|
value, take_ownership_from_abi};
|
|
}
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Microsoft::Windows::SemanticSearch::IEmbeddingVector>
|
|
: produce_base<
|
|
D, winrt::Microsoft::Windows::SemanticSearch::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_Count(uint32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<uint32_t>(this->shim().Count());
|
|
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::SemanticSearch::IEmbeddingVectorFactory>
|
|
: produce_base<
|
|
D,
|
|
winrt::Microsoft::Windows::SemanticSearch::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::SemanticSearch::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::SemanticSearch {
|
|
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::SemanticSearch::IEmbeddingVector>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::Windows::SemanticSearch::IEmbeddingVectorFactory>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Microsoft::Windows::SemanticSearch::EmbeddingVector>
|
|
: winrt::impl::hash_base {};
|
|
#endif
|
|
#ifdef __cpp_lib_format
|
|
#endif
|
|
} // namespace std
|
|
#endif
|