forked from KDAB/KDUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos_platform_event_loop.h
More file actions
48 lines (33 loc) · 1.41 KB
/
macos_platform_event_loop.h
File metadata and controls
48 lines (33 loc) · 1.41 KB
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
40
41
42
43
44
45
46
47
48
/*
This file is part of KDUtils.
SPDX-FileCopyrightText: 2018 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 <KDFoundation/platform/abstract_platform_event_loop.h>
#include <KDFoundation/kdfoundation_global.h>
#include <unordered_map>
namespace KDFoundation {
class MacOSPlatformTimer;
class KDFOUNDATION_API MacOSPlatformEventLoop : public AbstractPlatformEventLoop
{
public:
MacOSPlatformEventLoop();
~MacOSPlatformEventLoop() override;
MacOSPlatformEventLoop(MacOSPlatformEventLoop const &other) = delete;
MacOSPlatformEventLoop &operator=(MacOSPlatformEventLoop const &other) = delete;
MacOSPlatformEventLoop(MacOSPlatformEventLoop &&other) = delete;
MacOSPlatformEventLoop &operator=(MacOSPlatformEventLoop &&other) = delete;
void waitForEvents(int timeout) override;
void wakeUp() override;
bool registerNotifier(FileDescriptorNotifier *notifier) override;
bool unregisterNotifier(FileDescriptorNotifier *notifier) override;
static void postEmptyEvent();
private:
std::unique_ptr<AbstractPlatformTimer> createPlatformTimerImpl(Timer *timer) override;
std::unordered_map<void *, MacOSPlatformTimer *> timerMap;
friend class MacOSPlatformTimer;
};
} // namespace KDFoundation