// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Microsoft_UI_Dispatching_H #define WINRT_Microsoft_UI_Dispatching_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/Microsoft.UI.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Microsoft.UI.Dispatching.2.h" namespace winrt::impl { template auto consume_Microsoft_UI_Dispatching_IDispatcherExitDeferral::Complete() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherExitDeferral)->Complete()); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::CreateTimer() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue)->CreateTimer(&result)); return winrt::Microsoft::UI::Dispatching::DispatcherQueueTimer{ result, take_ownership_from_abi }; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::TryEnqueue(winrt::Microsoft::UI::Dispatching::DispatcherQueueHandler const& callback) const { bool result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue)->TryEnqueue(*(void**)(&callback), &result)); return result; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::TryEnqueue(winrt::Microsoft::UI::Dispatching::DispatcherQueuePriority const& priority, winrt::Microsoft::UI::Dispatching::DispatcherQueueHandler const& callback) const { bool result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue)->TryEnqueueWithPriority(static_cast(priority), *(void**)(&callback), &result)); return result; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::ShutdownStarting(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue)->add_ShutdownStarting(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::ShutdownStarting(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ShutdownStarting(handler)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::ShutdownStarting(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue)->remove_ShutdownStarting(impl::bind_in(token)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::ShutdownCompleted(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue)->add_ShutdownCompleted(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::ShutdownCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, ShutdownCompleted(handler)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue::ShutdownCompleted(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue)->remove_ShutdownCompleted(impl::bind_in(token)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue2::HasThreadAccess() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue2)->get_HasThreadAccess(&value)); return value; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::EnqueueEventLoopExit() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->EnqueueEventLoopExit()); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::EnsureSystemDispatcherQueue() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->EnsureSystemDispatcherQueue()); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::RunEventLoop() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->RunEventLoop()); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::RunEventLoop(winrt::Microsoft::UI::Dispatching::DispatcherRunOptions const& options, winrt::Microsoft::UI::Dispatching::DispatcherExitDeferral const& deferral) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->RunEventLoopWithOptions(static_cast(options), *(void**)(&deferral))); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::FrameworkShutdownStarting(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->add_FrameworkShutdownStarting(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::FrameworkShutdownStarting(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, FrameworkShutdownStarting(handler)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::FrameworkShutdownStarting(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->remove_FrameworkShutdownStarting(impl::bind_in(token)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::FrameworkShutdownCompleted(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->add_FrameworkShutdownCompleted(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::FrameworkShutdownCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, FrameworkShutdownCompleted(handler)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueue3::FrameworkShutdownCompleted(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueue3)->remove_FrameworkShutdownCompleted(impl::bind_in(token)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueController::DispatcherQueue() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueController)->get_DispatcherQueue(&value)); return winrt::Microsoft::UI::Dispatching::DispatcherQueue{ value, take_ownership_from_abi }; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueController::ShutdownQueueAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueController)->ShutdownQueueAsync(&operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueController2::ShutdownQueue() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueController2)->ShutdownQueue()); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueControllerStatics::CreateOnDedicatedThread() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueControllerStatics)->CreateOnDedicatedThread(&result)); return winrt::Microsoft::UI::Dispatching::DispatcherQueueController{ result, take_ownership_from_abi }; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueControllerStatics::CreateOnCurrentThread() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueControllerStatics)->CreateOnCurrentThread(&result)); return winrt::Microsoft::UI::Dispatching::DispatcherQueueController{ result, take_ownership_from_abi }; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueShutdownStartingEventArgs::GetDeferral() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueShutdownStartingEventArgs)->GetDeferral(&result)); return winrt::Windows::Foundation::Deferral{ result, take_ownership_from_abi }; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueStatics::GetForCurrentThread() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueStatics)->GetForCurrentThread(&result)); return winrt::Microsoft::UI::Dispatching::DispatcherQueue{ result, take_ownership_from_abi }; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::Interval() const { winrt::Windows::Foundation::TimeSpan value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->get_Interval(put_abi(value))); return value; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::Interval(winrt::Windows::Foundation::TimeSpan const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->put_Interval(impl::bind_in(value))); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::IsRunning() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->get_IsRunning(&value)); return value; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::IsRepeating() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->get_IsRepeating(&value)); return value; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::IsRepeating(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->put_IsRepeating(value)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::Start() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->Start()); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::Stop() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->Stop()); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::Tick(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->add_Tick(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::Tick(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Tick(handler)); } template auto consume_Microsoft_UI_Dispatching_IDispatcherQueueTimer::Tick(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::UI::Dispatching::IDispatcherQueueTimer)->remove_Tick(impl::bind_in(token)); } template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke() noexcept final try { (*this)(); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall Complete() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Complete(); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateTimer(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateTimer()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall TryEnqueue(void* callback, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().TryEnqueue(*reinterpret_cast(&callback))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall TryEnqueueWithPriority(int32_t priority, void* callback, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().TryEnqueue(*reinterpret_cast(&priority), *reinterpret_cast(&callback))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ShutdownStarting(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().ShutdownStarting(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ShutdownStarting(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ShutdownStarting(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_ShutdownCompleted(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().ShutdownCompleted(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ShutdownCompleted(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ShutdownCompleted(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_HasThreadAccess(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HasThreadAccess()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall EnqueueEventLoopExit() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().EnqueueEventLoopExit(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall EnsureSystemDispatcherQueue() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().EnsureSystemDispatcherQueue(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RunEventLoop() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RunEventLoop(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RunEventLoopWithOptions(uint32_t options, void* deferral) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RunEventLoop(*reinterpret_cast(&options), *reinterpret_cast(&deferral)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_FrameworkShutdownStarting(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().FrameworkShutdownStarting(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_FrameworkShutdownStarting(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().FrameworkShutdownStarting(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_FrameworkShutdownCompleted(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().FrameworkShutdownCompleted(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_FrameworkShutdownCompleted(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().FrameworkShutdownCompleted(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DispatcherQueue(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DispatcherQueue()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShutdownQueueAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ShutdownQueueAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall ShutdownQueue() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ShutdownQueue(); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateOnDedicatedThread(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateOnDedicatedThread()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateOnCurrentThread(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateOnCurrentThread()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDeferral(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDeferral()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetForCurrentThread(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetForCurrentThread()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Interval(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Interval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Interval(int64_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Interval(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsRunning(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsRunning()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsRepeating(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsRepeating()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IsRepeating(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IsRepeating(value); 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_Tick(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Tick(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Tick(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Tick(*reinterpret_cast(&token)); return 0; } }; #endif } WINRT_EXPORT namespace winrt::Microsoft::UI::Dispatching { constexpr auto operator|(DispatcherRunOptions const left, DispatcherRunOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(DispatcherRunOptions& left, DispatcherRunOptions const right) noexcept { left = left | right; return left; } constexpr auto operator&(DispatcherRunOptions const left, DispatcherRunOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(DispatcherRunOptions& left, DispatcherRunOptions const right) noexcept { left = left & right; return left; } constexpr auto operator~(DispatcherRunOptions const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(DispatcherRunOptions const left, DispatcherRunOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(DispatcherRunOptions& left, DispatcherRunOptions const right) noexcept { left = left ^ right; return left; } inline DispatcherExitDeferral::DispatcherExitDeferral() : DispatcherExitDeferral(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline auto DispatcherQueue::GetForCurrentThread() { return impl::call_factory_cast([](IDispatcherQueueStatics const& f) { return f.GetForCurrentThread(); }); } inline auto DispatcherQueueController::CreateOnDedicatedThread() { return impl::call_factory_cast([](IDispatcherQueueControllerStatics const& f) { return f.CreateOnDedicatedThread(); }); } inline auto DispatcherQueueController::CreateOnCurrentThread() { return impl::call_factory_cast([](IDispatcherQueueControllerStatics const& f) { return f.CreateOnCurrentThread(); }); } template DispatcherQueueHandler::DispatcherQueueHandler(L handler) : DispatcherQueueHandler(impl::make_delegate(std::forward(handler))) { } template DispatcherQueueHandler::DispatcherQueueHandler(F* handler) : DispatcherQueueHandler([=](auto&&... args) { return handler(args...); }) { } template DispatcherQueueHandler::DispatcherQueueHandler(O* object, M method) : DispatcherQueueHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template DispatcherQueueHandler::DispatcherQueueHandler(com_ptr&& object, M method) : DispatcherQueueHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DispatcherQueueHandler::DispatcherQueueHandler(weak_ref&& object, LM&& lambda_or_method) : DispatcherQueueHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template DispatcherQueueHandler::DispatcherQueueHandler(std::shared_ptr&& object, M method) : DispatcherQueueHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template DispatcherQueueHandler::DispatcherQueueHandler(std::weak_ptr&& object, LM&& lambda_or_method) : DispatcherQueueHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto DispatcherQueueHandler::operator()() const { check_hresult((*(impl::abi_t**)this)->Invoke()); } } 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 {}; 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