summaryrefslogtreecommitdiff
path: root/src/plugins/boot2qt/device-detection/qdbmessagetracker.h
blob: d2feac393926eb9ea4d2f43d71b8662c921b3af4 (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
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <QObject>
#include <QContiguousCache>

namespace Qdb::Internal {

class QdbWatcher;

class QdbMessageTracker : public QObject
{
    Q_OBJECT
public:
    QdbMessageTracker(QObject *parent = nullptr);

    void start();
    void stop();

signals:
    void trackerError(QString errorMessage);

private:
    void handleWatchMessage(const QJsonDocument &document);

    QdbWatcher *m_qdbWatcher = nullptr;
    QContiguousCache<QString> m_messageCache = QContiguousCache<QString>(10);
};

} // Qdb::Internal