// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Devices_Sensors_Custom_H #define WINRT_Windows_Devices_Sensors_Custom_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.Devices.Sensors.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Devices.Sensors.Custom.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor)->GetCurrentReading(&value)); return winrt::Windows::Devices::Sensors::Custom::CustomSensorReading{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor)->get_MinimumReportInterval(&value)); return value; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor)->put_ReportInterval(value)); } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor)->get_ReportInterval(&value)); return value; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::ReadingChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::ReadingChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ReadingChanged(handler)); } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor)->remove_ReadingChanged(impl::bind_in(token)); } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor2::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor2)->put_ReportLatency(value)); } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor2::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor2)->get_ReportLatency(&value)); return value; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensor2::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensor2)->get_MaxBatchSize(&value)); return value; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensorReading::Timestamp() const { winrt::Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensorReading)->get_Timestamp(put_abi(value))); return value; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensorReading::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensorReading)->get_Properties(&value)); return winrt::Windows::Foundation::Collections::IMapView{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensorReading2::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensorReading2)->get_PerformanceCount(&value)); return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensorReadingChangedEventArgs::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensorReadingChangedEventArgs)->get_Reading(&value)); return winrt::Windows::Devices::Sensors::Custom::CustomSensorReading{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensorStatics::GetDeviceSelector(winrt::guid const& interfaceId) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensorStatics)->GetDeviceSelector(impl::bind_in(interfaceId), &result)); return hstring{ result, take_ownership_from_abi }; } template auto consume_Windows_Devices_Sensors_Custom_ICustomSensorStatics::FromIdAsync(param::hstring const& sensorId) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Sensors::Custom::ICustomSensorStatics)->FromIdAsync(*(void**)(&sensorId), &result)); return winrt::Windows::Foundation::IAsyncOperation{ result, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().ReadingChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeviceSelector(winrt::guid interfaceId, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDeviceSelector(*reinterpret_cast(&interfaceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* sensorId, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().FromIdAsync(*reinterpret_cast(&sensorId))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Sensors::Custom { inline auto CustomSensor::GetDeviceSelector(winrt::guid const& interfaceId) { return impl::call_factory([&](ICustomSensorStatics const& f) { return f.GetDeviceSelector(interfaceId); }); } inline auto CustomSensor::FromIdAsync(param::hstring const& sensorId) { return impl::call_factory([&](ICustomSensorStatics const& f) { return f.FromIdAsync(sensorId); }); } } 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 {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; 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 } #endif