summaryrefslogtreecommitdiffstats
path: root/src/opcua/client/qopcuahistoryreadresponse.h
blob: 3a8948ef8d0ba6ab6b65a6b8db80cee43c852e00 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (C) 2021 basysKom GmbH, opensource@basyskom.com
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QOPCUAHISTORYREADRESPONSE_H
#define QOPCUAHISTORYREADRESPONSE_H

#include <QtOpcUa/qopcuahistorydata.h>
#include <QtOpcUa/qopcuahistoryevent.h>
#include <QtOpcUa/qopcuaglobal.h>

#include <QtOpcUa/qopcuahistoryreadrawrequest.h>

#include <QtCore/qpointer.h>

QT_BEGIN_NAMESPACE

class QOpcUaHistoryReadResponseImpl;

class QOpcUaHistoryReadResponsePrivate;

class Q_OPCUA_EXPORT QOpcUaHistoryReadResponse : public QObject {
    Q_OBJECT
    Q_DECLARE_PRIVATE(QOpcUaHistoryReadResponse)
public:
    explicit QOpcUaHistoryReadResponse(QOpcUaHistoryReadResponseImpl *impl);
    ~QOpcUaHistoryReadResponse();

    enum class State : quint32 {
        Unknown,
        Reading,
        Finished,
        MoreDataAvailable,
        Error
    };
    Q_ENUM(State)

    bool hasMoreData() const;
    bool readMoreData();
    State state() const;

    bool releaseContinuationPoints();

    QList<QOpcUaHistoryData> data() const;
    QList<QOpcUaHistoryEvent> events() const;
    QOpcUa::UaStatusCode serviceResult() const;

Q_SIGNALS:
    void readHistoryDataFinished(const QList<QOpcUaHistoryData> &results, QOpcUa::UaStatusCode serviceResult);
    void readHistoryEventsFinished(const QList<QOpcUaHistoryEvent> &results, QOpcUa::UaStatusCode serviceResult);
    void stateChanged(State state);
};

QT_END_NAMESPACE

#endif // QOPCUAHISTORYREADRESPONSE_H