blob: c1fe8578e31b242b2b98c53d763585b3df989d42 (
plain)
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
|
#pragma once
#include <mbgl/util/logging.hpp>
#include <mbgl/util/async_task.hpp>
#include <mbgl/util/run_loop.hpp>
#include <QEventLoop>
#include <QObject>
#include <QSocketNotifier>
#include <unordered_map>
namespace mbgl {
namespace util {
using WatchCallback = std::function<void(int, RunLoop::Event)>;
using WatchPair = std::pair<std::unique_ptr<QSocketNotifier>, WatchCallback>;
class RunLoop::Impl : public QObject {
Q_OBJECT
public:
Impl() = default;
RunLoop::Type type;
std::unique_ptr<QEventLoop> loop;
std::unique_ptr<AsyncTask> async;
std::unordered_map<int, WatchPair> readPoll;
std::unordered_map<int, WatchPair> writePoll;
public slots:
void onReadEvent(int fd);
void onWriteEvent(int fd);
};
} // namespace util
} // namespace mbgl
|