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#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
9#include "loop_win32_intf.hpp"
10#endif
11#include "../macros.hpp"
12#include <utility>
13#include <coroutine>
14#include <chrono>
15
16hi_export_module(hikogui.dispatch : awaitable_timer_impl);
17
18hi_export namespace hi::inline v1 {
19
20inline void awaitable_timer::await_suspend(std::coroutine_handle<> handle) noexcept
21{
22 _callback = loop::local().delay_function(_deadline, [=]() {
23 handle.resume();
24 });
25}
26
27}
DOXYGEN BUG.
Definition algorithm_misc.hpp:20