1// Copyright (C) 2018 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 QOPCUANODECREATIONATTRIBUTES_P_H
5#define QOPCUANODECREATIONATTRIBUTES_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qopcuatype.h"
19
20#include <QSharedData>
21#include <private/qglobal_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QOpcUaNodeCreationAttributesPrivate : public QSharedData
26{
27public:
28 QOpcUaNodeCreationAttributesPrivate()
29 : mask(0)
30 {}
31
32 // Bit positions from OPC-UA part 4, 7.19.1
33 enum class BitMask : quint32 {
34 AccessLevel = 0,
35 ArrayDimensions = 1,
36 ContainsNoLoops = 3,
37 DataType = 4,
38 Description = 5,
39 DisplayName = 6,
40 EventNotifier = 7,
41 Executable = 8,
42 Historizing = 9,
43 InverseName = 10,
44 IsAbstract = 11,
45 MinimumSamplingInterval = 12,
46 Symmetric = 15,
47 UserAccessLevel = 16,
48 UserExecutable = 17,
49 UserWriteMask = 18,
50 ValueRank = 19,
51 WriteMask = 20,
52 Value = 21
53 };
54
55 void setAttributeInMask(QOpcUaNodeCreationAttributesPrivate::BitMask attribute)
56 {
57 const quint32 position = static_cast<quint32>(attribute);
58 mask |= (1 << position);
59 }
60
61 bool attributeSet(QOpcUaNodeCreationAttributesPrivate::BitMask attribute) const
62 {
63 const quint32 position = static_cast<quint32>(attribute);
64 return mask & (1 << position);
65 }
66
67 quint32 mask {0};
68 QOpcUa::AccessLevel accessLevel {QOpcUa::AccessLevelBit::None};
69 QList<quint32> arrayDimensions;
70 bool containsNoLoops {false};
71 QString dataTypeId;
72 QOpcUaLocalizedText description;
73 QOpcUaLocalizedText displayName;
74 QOpcUa::EventNotifier eventNotifier {QOpcUa::EventNotifierBit::None};
75 bool executable {false};
76 bool historizing {false};
77 QOpcUaLocalizedText inverseName;
78 bool isAbstract {false};
79 double minimumSamplingInterval {0};
80 bool symmetric {false};
81 QOpcUa::AccessLevel userAccessLevel {QOpcUa::AccessLevelBit::None};
82 bool userExecutable {false};
83 QOpcUa::WriteMask userWriteMask {QOpcUa::WriteMaskBit::None};
84 qint32 valueRank {0};
85 QOpcUa::WriteMask writeMask {QOpcUa::WriteMaskBit::None};
86 QVariant value;
87 QOpcUa::Types valueType {QOpcUa::Types::Undefined};
88};
89
90QT_END_NAMESPACE
91
92#endif // QOPCUANODECREATIONATTRIBUTES_P_H
93

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