HikoGUI
Select Version:
⚠️ This documents the main development branch of HikoGUI. It might differ from release versions.
A low latency retained GUI
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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_win32_intf.hpp"
9#include "../macros.hpp"
10#include <utility>
11#include <coroutine>
12#include <chrono>
13
14hi_export_module(hikogui.dispatch : awaitable_timer_impl);
15
16hi_export namespace hi::inline v1 {
17
18inline void awaitable_timer::await_suspend(std::coroutine_handle<> handle) noexcept
19{
20 _callback = loop::local().delay_function(_deadline, [=]() {
21 handle.resume();
22 });
23}
24
25}
DOXYGEN BUG.
Definition algorithm_misc.hpp:20