| 1 | // Copyright (C) 2023 basysKom GmbH, opensource@basyskom.com |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QOPCUAHISTORYEVENT_H |
| 5 | #define QOPCUAHISTORYEVENT_H |
| 6 | |
| 7 | #include <QtOpcUa/qopcuatype.h> |
| 8 | |
| 9 | #include <QtOpcUa/qopcuaglobal.h> |
| 10 | |
| 11 | #include <QtCore/qcontainerfwd.h> |
| 12 | #include <QtCore/qstringfwd.h> |
| 13 | #include <QtCore/qshareddata.h> |
| 14 | |
| 15 | QT_BEGIN_NAMESPACE |
| 16 | |
| 17 | class QOpcUaHistoryEventData; |
| 18 | QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QOpcUaHistoryEventData, Q_OPCUA_EXPORT) |
| 19 | class QOpcUaHistoryEvent |
| 20 | { |
| 21 | public: |
| 22 | Q_OPCUA_EXPORT QOpcUaHistoryEvent(); |
| 23 | Q_OPCUA_EXPORT explicit QOpcUaHistoryEvent(const QString &nodeId); |
| 24 | Q_OPCUA_EXPORT QOpcUaHistoryEvent(const QOpcUaHistoryEvent &other); |
| 25 | Q_OPCUA_EXPORT QOpcUaHistoryEvent &operator=(const QOpcUaHistoryEvent &other); |
| 26 | QOpcUaHistoryEvent(QOpcUaHistoryEvent &&other) noexcept = default; |
| 27 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QOpcUaHistoryEvent) |
| 28 | Q_OPCUA_EXPORT ~QOpcUaHistoryEvent(); |
| 29 | |
| 30 | void swap(QOpcUaHistoryEvent &other) noexcept |
| 31 | { data.swap(other&: other.data); } |
| 32 | |
| 33 | Q_OPCUA_EXPORT QOpcUa::UaStatusCode statusCode() const; |
| 34 | Q_OPCUA_EXPORT void setStatusCode(QOpcUa::UaStatusCode statusCode); |
| 35 | Q_OPCUA_EXPORT QList<QVariantList> events() const; |
| 36 | Q_OPCUA_EXPORT int count() const; |
| 37 | Q_OPCUA_EXPORT void addEvent(const QVariantList &value); |
| 38 | Q_OPCUA_EXPORT QString nodeId() const; |
| 39 | Q_OPCUA_EXPORT void setNodeId(const QString &nodeId); |
| 40 | |
| 41 | private: |
| 42 | friend Q_OPCUA_EXPORT bool comparesEqual(const QOpcUaHistoryEvent &lhs, |
| 43 | const QOpcUaHistoryEvent &rhs) noexcept; |
| 44 | friend bool operator==(const QOpcUaHistoryEvent &lhs, const QOpcUaHistoryEvent &rhs) noexcept |
| 45 | { return comparesEqual(lhs, rhs); } |
| 46 | friend bool operator!=(const QOpcUaHistoryEvent &lhs, const QOpcUaHistoryEvent &rhs) noexcept |
| 47 | { |
| 48 | return !(lhs == rhs); |
| 49 | } |
| 50 | |
| 51 | QExplicitlySharedDataPointer<QOpcUaHistoryEventData> data; |
| 52 | }; |
| 53 | |
| 54 | Q_DECLARE_SHARED(QOpcUaHistoryEvent) |
| 55 | |
| 56 | QT_END_NAMESPACE |
| 57 | |
| 58 | #endif // QOPCUAHISTORYEVENT_H |
| 59 |
