| 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 QOPCUAENUMDEFINITION_H | 
| 5 | #define QOPCUAENUMDEFINITION_H | 
| 6 | |
| 7 | #include <QtOpcUa/qopcuaglobal.h> | 
| 8 | |
| 9 | #include <QtCore/qcontainerfwd.h> | 
| 10 | #include <QtCore/qshareddata.h> | 
| 11 | |
| 12 | QT_BEGIN_NAMESPACE | 
| 13 | |
| 14 | class QOpcUaEnumDefinitionData; | 
| 15 | class QOpcUaEnumField; | 
| 16 | |
| 17 | QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QOpcUaEnumDefinitionData, Q_OPCUA_EXPORT) | 
| 18 | |
| 19 | class QOpcUaEnumDefinition | 
| 20 | { | 
| 21 | public: | 
| 22 | Q_OPCUA_EXPORT QOpcUaEnumDefinition(); | 
| 23 | Q_OPCUA_EXPORT QOpcUaEnumDefinition(const QOpcUaEnumDefinition &other); | 
| 24 | void swap(QOpcUaEnumDefinition &other) noexcept | 
| 25 | { data.swap(other&: other.data); } | 
| 26 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QOpcUaEnumDefinition) | 
| 27 | QOpcUaEnumDefinition(QOpcUaEnumDefinition &&other) noexcept = default; | 
| 28 | Q_OPCUA_EXPORT QOpcUaEnumDefinition &operator=(const QOpcUaEnumDefinition &rhs); | 
| 29 | Q_OPCUA_EXPORT operator QVariant() const; | 
| 30 | Q_OPCUA_EXPORT ~QOpcUaEnumDefinition(); | 
| 31 | |
| 32 | Q_OPCUA_EXPORT QList<QOpcUaEnumField> fields() const; | 
| 33 | Q_OPCUA_EXPORT void setFields(const QList<QOpcUaEnumField> &fields); | 
| 34 | |
| 35 | private: | 
| 36 | QExplicitlySharedDataPointer<QOpcUaEnumDefinitionData> data; | 
| 37 | |
| 38 | friend Q_OPCUA_EXPORT bool comparesEqual(const QOpcUaEnumDefinition &lhs, | 
| 39 | const QOpcUaEnumDefinition &rhs) noexcept; | 
| 40 | friend bool operator==(const QOpcUaEnumDefinition &lhs, | 
| 41 | const QOpcUaEnumDefinition &rhs) noexcept | 
| 42 | { return comparesEqual(lhs, rhs); } | 
| 43 | friend inline bool operator!=(const QOpcUaEnumDefinition &lhs, const QOpcUaEnumDefinition &rhs) noexcept | 
| 44 | { | 
| 45 | return !(lhs == rhs); | 
| 46 | } | 
| 47 | }; | 
| 48 | |
| 49 | Q_DECLARE_SHARED(QOpcUaEnumDefinition) | 
| 50 | |
| 51 | QT_END_NAMESPACE | 
| 52 | |
| 53 | #endif // QOPCUAENUMDEFINITION_H | 
| 54 | 
