forked from KDAB/KDUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos_platform_timer.h
More file actions
39 lines (27 loc) · 868 Bytes
/
macos_platform_timer.h
File metadata and controls
39 lines (27 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
This file is part of KDUtils.
SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author: Paul Lemire <paul.lemire@kdab.com>
SPDX-License-Identifier: MIT
Contact KDAB at <info@kdab.com> for commercial licensing options.
*/
#pragma once
#include <Foundation/Foundation.h>
#include <chrono>
#include <KDFoundation/platform/abstract_platform_timer.h>
#include <KDFoundation/file_descriptor_notifier.h>
namespace KDFoundation {
class Timer;
class KDFOUNDATION_API MacOSPlatformTimer : public AbstractPlatformTimer
{
public:
MacOSPlatformTimer(Timer *timer);
~MacOSPlatformTimer() override;
private:
void arm(std::chrono::microseconds us);
void disarm();
static void timerFired(void *context);
Timer *m_handler;
dispatch_source_t highResTimer;
};
} // namespace KDFoundation