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 QOPCUAENUMFIELD_H
5#define QOPCUAENUMFIELD_H
6
7#include <QtOpcUa/qopcuaglobal.h>
8
9#include <QtCore/qshareddata.h>
10#include <QtCore/qstringfwd.h>
11
12QT_BEGIN_NAMESPACE
13
14class QOpcUaEnumFieldData;
15class QOpcUaLocalizedText;
16
17class QVariant;
18
19QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QOpcUaEnumFieldData, Q_OPCUA_EXPORT)
20
21class QOpcUaEnumField
22{
23public:
24 Q_OPCUA_EXPORT QOpcUaEnumField();
25 Q_OPCUA_EXPORT QOpcUaEnumField(const QOpcUaEnumField &other);
26 void swap(QOpcUaEnumField &other) noexcept
27 { data.swap(other&: other.data); }
28 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QOpcUaEnumField)
29 QOpcUaEnumField(QOpcUaEnumField &&other) noexcept = default;
30 Q_OPCUA_EXPORT QOpcUaEnumField &operator=(const QOpcUaEnumField &rhs);
31 Q_OPCUA_EXPORT operator QVariant() const;
32 Q_OPCUA_EXPORT ~QOpcUaEnumField();
33
34
35 Q_OPCUA_EXPORT qint64 value() const;
36 Q_OPCUA_EXPORT void setValue(qint64 value);
37
38 Q_OPCUA_EXPORT QOpcUaLocalizedText displayName() const;
39 Q_OPCUA_EXPORT void setDisplayName(const QOpcUaLocalizedText &displayName);
40
41 Q_OPCUA_EXPORT QOpcUaLocalizedText description() const;
42 Q_OPCUA_EXPORT void setDescription(const QOpcUaLocalizedText &description);
43
44 Q_OPCUA_EXPORT QString name() const;
45 Q_OPCUA_EXPORT void setName(const QString &name);
46
47private:
48 QExplicitlySharedDataPointer<QOpcUaEnumFieldData> data;
49
50 friend Q_OPCUA_EXPORT bool comparesEqual(const QOpcUaEnumField &lhs,
51 const QOpcUaEnumField &rhs) noexcept;
52 friend bool operator==(const QOpcUaEnumField &lhs, const QOpcUaEnumField &rhs) noexcept
53 { return comparesEqual(lhs, rhs); }
54 friend bool operator!=(const QOpcUaEnumField &lhs, const QOpcUaEnumField &rhs) noexcept
55 {
56 return !(lhs == rhs);
57 }
58};
59
60Q_DECLARE_SHARED(QOpcUaEnumField)
61
62QT_END_NAMESPACE
63
64#endif // QOPCUAENUMFIELD_H
65

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtopcua/src/opcua/client/qopcuaenumfield.h