LeechCraft 0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
timer.cpp
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#include "timer.h"
10
11namespace LC::Util::detail
12{
13 TimerAwaiter::TimerAwaiter (std::chrono::milliseconds duration, Qt::TimerType precision)
14 {
15 Timer_.setSingleShot (true);
16 Timer_.setInterval (duration);
17 Timer_.setTimerType (precision);
18 }
19
20 bool TimerAwaiter::await_ready () const noexcept
21 {
22 return false;
23 }
24
25 void TimerAwaiter::await_suspend (std::coroutine_handle<> handle) noexcept
26 {
27 Timer_.callOnTimeout (handle);
28 Timer_.start ();
29 }
30
31 void TimerAwaiter::await_resume () const noexcept
32 {
33 }
34}
bool await_ready() const noexcept
Definition timer.cpp:20
TimerAwaiter(std::chrono::milliseconds duration, Qt::TimerType precision)
Definition timer.cpp:13
void await_resume() const noexcept
Definition timer.cpp:31
void await_suspend(std::coroutine_handle<> handle) noexcept
Definition timer.cpp:25