HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
awaitable_timer_impl.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "awaitable_timer_intf.hpp"
8#include "loop.hpp"
9#include "../macros.hpp"
10
11hi_export_module(hikogui.dispatch.awaitable_timer : impl);
12
13namespace hi::inline v1 {
14
15inline void awaitable_timer::await_suspend(std::coroutine_handle<> handle) noexcept
16{
17 _token = loop::local().delay_function(_deadline, [handle = std::move(handle)]() {
18 handle.resume();
19 });
20}
21
22}
DOXYGEN BUG.
Definition algorithm.hpp:16
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
T move(T... args)