mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
1286 lines
58 KiB
C++
1286 lines
58 KiB
C++
// WARNING: Please don't edit this file. It was generated by C++/WinRT
|
|
// v2.0.250303.1
|
|
|
|
#pragma once
|
|
#ifndef WINRT_Windows_System_Power_Thermal_H
|
|
#define WINRT_Windows_System_Power_Thermal_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/Windows.System.Power.h"
|
|
#include "winrt/impl/Windows.Foundation.2.h"
|
|
#include "winrt/impl/Windows.Foundation.Collections.2.h"
|
|
#include "winrt/impl/Windows.System.Power.Thermal.2.h"
|
|
namespace winrt::impl {
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelConfiguration<
|
|
D>::Id() const {
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_Id(put_abi(value)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>**)this;
|
|
check_hresult(_winrt_abi_type->get_Id(put_abi(value)));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelConfiguration<
|
|
D>::ConfigurationString() const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_ConfigurationString(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>**)this;
|
|
check_hresult(_winrt_abi_type->get_ConfigurationString(&value));
|
|
}
|
|
return hstring{value, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelConfiguration<
|
|
D>::GetConfigurationNumericParameters() const {
|
|
uint32_t result_impl_size{};
|
|
int32_t* result{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetConfigurationNumericParameters(
|
|
&result_impl_size, &result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration>**)this;
|
|
check_hresult(_winrt_abi_type->GetConfigurationNumericParameters(
|
|
&result_impl_size, &result));
|
|
}
|
|
return com_array<int32_t>{result, result_impl_size, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<
|
|
D>::GetChannelIds() const {
|
|
uint32_t result_impl_size{};
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId* result{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetChannelIds(&result_impl_size, &result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
check_hresult(_winrt_abi_type->GetChannelIds(&result_impl_size, &result));
|
|
}
|
|
return com_array<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId>{
|
|
result, result_impl_size, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<
|
|
D>::GetChannelConfigurations() const {
|
|
void* result{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetChannelConfigurations(&result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
check_hresult(_winrt_abi_type->GetChannelConfigurations(&result));
|
|
}
|
|
return winrt::Windows::Foundation::Collections::IMapView<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId,
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelConfiguration>{
|
|
result, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<
|
|
D>::Start() const {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->Start());
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
check_hresult(_winrt_abi_type->Start());
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<
|
|
D>::Stop() const {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->Stop());
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
check_hresult(_winrt_abi_type->Stop());
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<D>::
|
|
ChannelDataReceived(winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer,
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataReceivedEventArgs> const&
|
|
handler) const {
|
|
winrt::event_token token{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->add_ChannelDataReceived(*(void**)(&handler),
|
|
put_abi(token)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
check_hresult(_winrt_abi_type->add_ChannelDataReceived(*(void**)(&handler),
|
|
put_abi(token)));
|
|
}
|
|
return token;
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<D>::
|
|
ChannelDataReceived(auto_revoke_t,
|
|
winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer,
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataReceivedEventArgs> const&
|
|
handler) const {
|
|
return impl::make_event_revoker<D, ChannelDataReceived_revoker>(
|
|
this, ChannelDataReceived(handler));
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<
|
|
D>::ChannelDataReceived(winrt::event_token const& token) const noexcept {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
_winrt_abi_type->remove_ChannelDataReceived(impl::bind_in(token));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
_winrt_abi_type->remove_ChannelDataReceived(impl::bind_in(token));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<
|
|
D>::BackEndStatus() const {
|
|
winrt::Windows::System::Power::Thermal::PowerThermalBackEndStatus value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
check_hresult(
|
|
_winrt_abi_type->get_BackEndStatus(reinterpret_cast<int32_t*>(&value)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
check_hresult(
|
|
_winrt_abi_type->get_BackEndStatus(reinterpret_cast<int32_t*>(&value)));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<D>::
|
|
BackEndStatusChanged(
|
|
winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer,
|
|
winrt::Windows::Foundation::IInspectable> const& handler) const {
|
|
winrt::event_token token{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->add_BackEndStatusChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
check_hresult(_winrt_abi_type->add_BackEndStatusChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
}
|
|
return token;
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<D>::
|
|
BackEndStatusChanged(
|
|
auto_revoke_t,
|
|
winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer,
|
|
winrt::Windows::Foundation::IInspectable> const& handler) const {
|
|
return impl::make_event_revoker<D, BackEndStatusChanged_revoker>(
|
|
this, BackEndStatusChanged(handler));
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumer<
|
|
D>::BackEndStatusChanged(winrt::event_token const& token) const noexcept {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)&_winrt_casted_result;
|
|
_winrt_abi_type->remove_BackEndStatusChanged(impl::bind_in(token));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer>**)this;
|
|
_winrt_abi_type->remove_BackEndStatusChanged(impl::bind_in(token));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataConsumerFactory<
|
|
D>::CreateInstance(array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const>
|
|
channelIds) const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumerFactory>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumerFactory,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumerFactory>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->CreateInstance(channelIds.size(),
|
|
get_abi(channelIds), &value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumerFactory>**)this;
|
|
check_hresult(_winrt_abi_type->CreateInstance(channelIds.size(),
|
|
get_abi(channelIds), &value));
|
|
}
|
|
return winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer{value, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<
|
|
D>::GetChannelIds() const {
|
|
uint32_t result_impl_size{};
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId* result{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetChannelIds(&result_impl_size, &result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(_winrt_abi_type->GetChannelIds(&result_impl_size, &result));
|
|
}
|
|
return com_array<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId>{
|
|
result, result_impl_size, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<
|
|
D>::GetChannelConfigurations() const {
|
|
void* result{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetChannelConfigurations(&result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(_winrt_abi_type->GetChannelConfigurations(&result));
|
|
}
|
|
return winrt::Windows::Foundation::Collections::IMapView<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId,
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelConfiguration>{
|
|
result, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<D>::
|
|
DisableChannel(
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId const&
|
|
channelId) const {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->DisableChannel(impl::bind_in(channelId)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(_winrt_abi_type->DisableChannel(impl::bind_in(channelId)));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<
|
|
D>::Start() const {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->Start());
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(_winrt_abi_type->Start());
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<
|
|
D>::Stop() const {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->Stop());
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(_winrt_abi_type->Stop());
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<D>::
|
|
PublishInputChannelData(array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelData const>
|
|
data) const {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(
|
|
_winrt_abi_type->PublishInputChannelData(data.size(), get_abi(data)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(
|
|
_winrt_abi_type->PublishInputChannelData(data.size(), get_abi(data)));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<
|
|
D>::BackEndStatus() const {
|
|
winrt::Windows::System::Power::Thermal::PowerThermalBackEndStatus value{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(
|
|
_winrt_abi_type->get_BackEndStatus(reinterpret_cast<int32_t*>(&value)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(
|
|
_winrt_abi_type->get_BackEndStatus(reinterpret_cast<int32_t*>(&value)));
|
|
}
|
|
return value;
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<D>::
|
|
BackEndStatusChanged(
|
|
winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataProducer,
|
|
winrt::Windows::Foundation::IInspectable> const& handler) const {
|
|
winrt::event_token token{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->add_BackEndStatusChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
check_hresult(_winrt_abi_type->add_BackEndStatusChanged(*(void**)(&handler),
|
|
put_abi(token)));
|
|
}
|
|
return token;
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<D>::
|
|
BackEndStatusChanged(
|
|
auto_revoke_t,
|
|
winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataProducer,
|
|
winrt::Windows::Foundation::IInspectable> const& handler) const {
|
|
return impl::make_event_revoker<D, BackEndStatusChanged_revoker>(
|
|
this, BackEndStatusChanged(handler));
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducer<
|
|
D>::BackEndStatusChanged(winrt::event_token const& token) const noexcept {
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)&_winrt_casted_result;
|
|
_winrt_abi_type->remove_BackEndStatusChanged(impl::bind_in(token));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer>**)this;
|
|
_winrt_abi_type->remove_BackEndStatusChanged(impl::bind_in(token));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataProducerFactory<
|
|
D>::CreateInstance(array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const>
|
|
channelIds) const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducerFactory>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducerFactory,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducerFactory>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->CreateInstance(channelIds.size(),
|
|
get_abi(channelIds), &value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducerFactory>**)this;
|
|
check_hresult(_winrt_abi_type->CreateInstance(channelIds.size(),
|
|
get_abi(channelIds), &value));
|
|
}
|
|
return winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataProducer{value, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDataReceivedEventArgs<
|
|
D>::GetData() const {
|
|
uint32_t result_impl_size{};
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelData* result{};
|
|
if constexpr (!std::is_same_v<
|
|
D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataReceivedEventArgs>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataReceivedEventArgs,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataReceivedEventArgs>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetData(&result_impl_size, &result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataReceivedEventArgs>**)this;
|
|
check_hresult(_winrt_abi_type->GetData(&result_impl_size, &result));
|
|
}
|
|
return com_array<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelData>{
|
|
result, result_impl_size, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDiagnosticsStatics<
|
|
D>::Current() const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_Current(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>**)this;
|
|
check_hresult(_winrt_abi_type->get_Current(&value));
|
|
}
|
|
return winrt::Windows::System::Power::Thermal::PowerThermalChannelDiagnostics{
|
|
value, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelDiagnosticsStatics<
|
|
D>::GetDataForChannels(array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const>
|
|
channelIds) const {
|
|
uint32_t result_impl_size{};
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelData* result{};
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->GetDataForChannels(
|
|
channelIds.size(), get_abi(channelIds), &result_impl_size, &result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>**)this;
|
|
check_hresult(_winrt_abi_type->GetDataForChannels(
|
|
channelIds.size(), get_abi(channelIds), &result_impl_size, &result));
|
|
}
|
|
return com_array<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelData>{
|
|
result, result_impl_size, take_ownership_from_abi};
|
|
}
|
|
template <typename D>
|
|
auto consume_Windows_System_Power_Thermal_IPowerThermalChannelFinderStatics<
|
|
D>::FindChannels(winrt::guid const& channelInterfaceType) const {
|
|
uint32_t result_impl_size{};
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId* result{};
|
|
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelFinderStatics>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelFinderStatics,
|
|
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::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelFinderStatics>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->FindChannels(
|
|
impl::bind_in(channelInterfaceType), &result_impl_size, &result));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelFinderStatics>**)this;
|
|
check_hresult(_winrt_abi_type->FindChannels(
|
|
impl::bind_in(channelInterfaceType), &result_impl_size, &result));
|
|
}
|
|
return com_array<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId>{
|
|
result, result_impl_size, take_ownership_from_abi};
|
|
}
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<
|
|
D,
|
|
winrt::Windows::System::Power::Thermal::IPowerThermalChannelConfiguration>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelConfiguration> {
|
|
int32_t __stdcall get_Id(
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId*
|
|
value) noexcept final try {
|
|
zero_abi<winrt::Windows::System::Power::Thermal::PowerThermalChannelId>(
|
|
value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId>(
|
|
this->shim().Id());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_ConfigurationString(void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<hstring>(this->shim().ConfigurationString());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall GetConfigurationNumericParameters(
|
|
uint32_t* __resultSize, int32_t** result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
std::tie(*__resultSize, *result) =
|
|
detach_abi(this->shim().GetConfigurationNumericParameters());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<
|
|
D, winrt::Windows::System::Power::Thermal::IPowerThermalChannelDataConsumer>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumer> {
|
|
int32_t __stdcall GetChannelIds(
|
|
uint32_t* __resultSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId**
|
|
result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
std::tie(*__resultSize, *result) = detach_abi(this->shim().GetChannelIds());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall GetChannelConfigurations(void** result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
*result = detach_from<winrt::Windows::Foundation::Collections::IMapView<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId,
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelConfiguration>>(
|
|
this->shim().GetChannelConfigurations());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall Start() noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().Start();
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall Stop() noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().Stop();
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall add_ChannelDataReceived(
|
|
void* handler, winrt::event_token* token) noexcept final try {
|
|
zero_abi<winrt::event_token>(token);
|
|
typename D::abi_guard guard(this->shim());
|
|
*token = detach_from<winrt::event_token>(this->shim().ChannelDataReceived(
|
|
*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer,
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataReceivedEventArgs> const*>(&handler)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall remove_ChannelDataReceived(
|
|
winrt::event_token token) noexcept final {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().ChannelDataReceived(
|
|
*reinterpret_cast<winrt::event_token const*>(&token));
|
|
return 0;
|
|
}
|
|
int32_t __stdcall get_BackEndStatus(int32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalBackEndStatus>(
|
|
this->shim().BackEndStatus());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall add_BackEndStatusChanged(
|
|
void* handler, winrt::event_token* token) noexcept final try {
|
|
zero_abi<winrt::event_token>(token);
|
|
typename D::abi_guard guard(this->shim());
|
|
*token = detach_from<winrt::event_token>(this->shim().BackEndStatusChanged(
|
|
*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer,
|
|
winrt::Windows::Foundation::IInspectable> const*>(&handler)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall remove_BackEndStatusChanged(
|
|
winrt::event_token token) noexcept final {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().BackEndStatusChanged(
|
|
*reinterpret_cast<winrt::event_token const*>(&token));
|
|
return 0;
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumerFactory>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumerFactory> {
|
|
int32_t __stdcall CreateInstance(
|
|
uint32_t __channelIdsSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId*
|
|
channelIds,
|
|
void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataConsumer>(
|
|
this->shim().CreateInstance(
|
|
array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const>(
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const*>(channelIds),
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const*>(channelIds) +
|
|
__channelIdsSize)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<
|
|
D, winrt::Windows::System::Power::Thermal::IPowerThermalChannelDataProducer>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducer> {
|
|
int32_t __stdcall GetChannelIds(
|
|
uint32_t* __resultSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId**
|
|
result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
std::tie(*__resultSize, *result) = detach_abi(this->shim().GetChannelIds());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall GetChannelConfigurations(void** result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
*result = detach_from<winrt::Windows::Foundation::Collections::IMapView<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId,
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelConfiguration>>(
|
|
this->shim().GetChannelConfigurations());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall DisableChannel(
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId
|
|
channelId) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().DisableChannel(
|
|
*reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const*>(&channelId));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall Start() noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().Start();
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall Stop() noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().Stop();
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall PublishInputChannelData(
|
|
uint32_t __dataSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelData*
|
|
data) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().PublishInputChannelData(
|
|
array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelData const>(
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelData const*>(data),
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelData const*>(data) +
|
|
__dataSize));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall get_BackEndStatus(int32_t* value) noexcept final try {
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalBackEndStatus>(
|
|
this->shim().BackEndStatus());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall add_BackEndStatusChanged(
|
|
void* handler, winrt::event_token* token) noexcept final try {
|
|
zero_abi<winrt::event_token>(token);
|
|
typename D::abi_guard guard(this->shim());
|
|
*token = detach_from<winrt::event_token>(this->shim().BackEndStatusChanged(
|
|
*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataProducer,
|
|
winrt::Windows::Foundation::IInspectable> const*>(&handler)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall remove_BackEndStatusChanged(
|
|
winrt::event_token token) noexcept final {
|
|
typename D::abi_guard guard(this->shim());
|
|
this->shim().BackEndStatusChanged(
|
|
*reinterpret_cast<winrt::event_token const*>(&token));
|
|
return 0;
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducerFactory>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducerFactory> {
|
|
int32_t __stdcall CreateInstance(
|
|
uint32_t __channelIdsSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId*
|
|
channelIds,
|
|
void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataProducer>(
|
|
this->shim().CreateInstance(
|
|
array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const>(
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const*>(channelIds),
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const*>(channelIds) +
|
|
__channelIdsSize)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataReceivedEventArgs>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataReceivedEventArgs> {
|
|
int32_t __stdcall GetData(
|
|
uint32_t* __resultSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelData**
|
|
result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
std::tie(*__resultSize, *result) = detach_abi(this->shim().GetData());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<
|
|
D, winrt::Windows::System::Power::Thermal::IPowerThermalChannelDiagnostics>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnostics> {};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics> {
|
|
int32_t __stdcall get_Current(void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelDiagnostics>(
|
|
this->shim().Current());
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
int32_t __stdcall GetDataForChannels(
|
|
uint32_t __channelIdsSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId*
|
|
channelIds,
|
|
uint32_t* __resultSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelData**
|
|
result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
std::tie(*__resultSize, *result) =
|
|
detach_abi(this->shim().GetDataForChannels(
|
|
array_view<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const>(
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const*>(channelIds),
|
|
reinterpret_cast<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelId const*>(channelIds) +
|
|
__channelIdsSize)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <typename D>
|
|
struct produce<
|
|
D,
|
|
winrt::Windows::System::Power::Thermal::IPowerThermalChannelFinderStatics>
|
|
: produce_base<D, winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelFinderStatics> {
|
|
int32_t __stdcall FindChannels(
|
|
winrt::guid channelInterfaceType, uint32_t* __resultSize,
|
|
struct struct_Windows_System_Power_Thermal_PowerThermalChannelId**
|
|
result) noexcept final try {
|
|
clear_abi(result);
|
|
typename D::abi_guard guard(this->shim());
|
|
std::tie(*__resultSize, *result) = detach_abi(this->shim().FindChannels(
|
|
*reinterpret_cast<winrt::guid const*>(&channelInterfaceType)));
|
|
return 0;
|
|
} catch (...) {
|
|
return to_hresult();
|
|
}
|
|
};
|
|
#endif
|
|
} // namespace winrt::impl
|
|
WINRT_EXPORT namespace winrt::Windows::System::Power::Thermal {
|
|
inline PowerThermalChannelDataConsumer::PowerThermalChannelDataConsumer(
|
|
array_view<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId const>
|
|
channelIds)
|
|
: PowerThermalChannelDataConsumer(
|
|
impl::call_factory<PowerThermalChannelDataConsumer,
|
|
IPowerThermalChannelDataConsumerFactory>(
|
|
[&](IPowerThermalChannelDataConsumerFactory const& f) {
|
|
return f.CreateInstance(channelIds);
|
|
})) {}
|
|
inline PowerThermalChannelDataProducer::PowerThermalChannelDataProducer(
|
|
array_view<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId const>
|
|
channelIds)
|
|
: PowerThermalChannelDataProducer(
|
|
impl::call_factory<PowerThermalChannelDataProducer,
|
|
IPowerThermalChannelDataProducerFactory>(
|
|
[&](IPowerThermalChannelDataProducerFactory const& f) {
|
|
return f.CreateInstance(channelIds);
|
|
})) {}
|
|
inline auto PowerThermalChannelDiagnostics::Current() {
|
|
return impl::call_factory_cast<
|
|
winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDiagnostics (*)(
|
|
IPowerThermalChannelDiagnosticsStatics const&),
|
|
PowerThermalChannelDiagnostics, IPowerThermalChannelDiagnosticsStatics>(
|
|
[](IPowerThermalChannelDiagnosticsStatics const& f) {
|
|
return f.Current();
|
|
});
|
|
}
|
|
inline auto PowerThermalChannelDiagnostics::GetDataForChannels(
|
|
array_view<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelId const>
|
|
channelIds) {
|
|
return impl::call_factory<PowerThermalChannelDiagnostics,
|
|
IPowerThermalChannelDiagnosticsStatics>(
|
|
[&](IPowerThermalChannelDiagnosticsStatics const& f) {
|
|
return f.GetDataForChannels(channelIds);
|
|
});
|
|
}
|
|
inline auto PowerThermalChannelFinder::FindChannels(
|
|
winrt::guid const& channelInterfaceType) {
|
|
return impl::call_factory<PowerThermalChannelFinder,
|
|
IPowerThermalChannelFinderStatics>(
|
|
[&](IPowerThermalChannelFinderStatics const& f) {
|
|
return f.FindChannels(channelInterfaceType);
|
|
});
|
|
}
|
|
}
|
|
namespace std {
|
|
#ifndef WINRT_LEAN_AND_MEAN
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::IPowerThermalChannelConfiguration>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::IPowerThermalChannelDataConsumer>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataConsumerFactory>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::IPowerThermalChannelDataProducer>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataProducerFactory>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDataReceivedEventArgs>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::IPowerThermalChannelDiagnostics>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Windows::System::Power::Thermal::
|
|
IPowerThermalChannelDiagnosticsStatics>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::IPowerThermalChannelFinderStatics>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelConfiguration>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelDataConsumer>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelDataProducer>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Windows::System::Power::Thermal::
|
|
PowerThermalChannelDataReceivedEventArgs>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<
|
|
winrt::Windows::System::Power::Thermal::PowerThermalChannelDiagnostics>
|
|
: winrt::impl::hash_base {};
|
|
template <>
|
|
struct hash<winrt::Windows::System::Power::Thermal::PowerThermalChannelFinder>
|
|
: winrt::impl::hash_base {};
|
|
#endif
|
|
#ifdef __cpp_lib_format
|
|
#endif
|
|
} // namespace std
|
|
#endif
|