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 | #include "qopcuanodecreationattributes.h" |
5 | #include "qopcuadeletereferenceitem.h" |
6 | #include "qopcuaexpandednodeid.h" |
7 | |
8 | QT_BEGIN_NAMESPACE |
9 | |
10 | /*! |
11 | \class QOpcUaDeleteReferenceItem |
12 | \inmodule QtOpcUa |
13 | \brief This class stores the necessary information to delete a reference from the server. |
14 | |
15 | \sa QOpcUaClient::deleteReference() |
16 | */ |
17 | |
18 | class QOpcUaDeleteReferenceItemData : public QSharedData |
19 | { |
20 | public: |
21 | QString sourceNodeId; |
22 | QString referenceTypeId; |
23 | bool isForwardReference {true}; |
24 | QOpcUaExpandedNodeId targetNodeId; |
25 | bool deleteBidirectional {true}; |
26 | }; |
27 | |
28 | QOpcUaDeleteReferenceItem::QOpcUaDeleteReferenceItem() |
29 | : data(new QOpcUaDeleteReferenceItemData) |
30 | { |
31 | } |
32 | |
33 | /*! |
34 | Constructs a delete reference item from \a other. |
35 | */ |
36 | QOpcUaDeleteReferenceItem::QOpcUaDeleteReferenceItem(const QOpcUaDeleteReferenceItem &other) |
37 | : data(other.data) |
38 | { |
39 | } |
40 | |
41 | /*! |
42 | Sets the values from \a rhs in this delete reference item. |
43 | */ |
44 | QOpcUaDeleteReferenceItem &QOpcUaDeleteReferenceItem::operator=(const QOpcUaDeleteReferenceItem &rhs) |
45 | { |
46 | if (this != &rhs) |
47 | data.operator=(o: rhs.data); |
48 | return *this; |
49 | } |
50 | |
51 | QOpcUaDeleteReferenceItem::~QOpcUaDeleteReferenceItem() |
52 | { |
53 | } |
54 | |
55 | /*! |
56 | Returns the deleteBidirectional Flag. |
57 | */ |
58 | bool QOpcUaDeleteReferenceItem::deleteBidirectional() const |
59 | { |
60 | return data->deleteBidirectional; |
61 | } |
62 | |
63 | /*! |
64 | Sets the deleteBidirectional flag to \a deleteBidirectional. |
65 | If this flag is false, only this reference will be deleted. |
66 | Else, the opposite reference from the target node is deleted too if accessible by the server. |
67 | */ |
68 | void QOpcUaDeleteReferenceItem::setDeleteBidirectional(bool deleteBidirectional) |
69 | { |
70 | data->deleteBidirectional = deleteBidirectional; |
71 | } |
72 | |
73 | /*! |
74 | Returns the target node id. |
75 | */ |
76 | QOpcUaExpandedNodeId QOpcUaDeleteReferenceItem::targetNodeId() const |
77 | { |
78 | return data->targetNodeId; |
79 | } |
80 | |
81 | /*! |
82 | Sets the node id of the target node to \a targetNodeId. |
83 | */ |
84 | void QOpcUaDeleteReferenceItem::setTargetNodeId(const QOpcUaExpandedNodeId &targetNodeId) |
85 | { |
86 | data->targetNodeId = targetNodeId; |
87 | } |
88 | |
89 | /*! |
90 | Returns the isForwardReference flag. |
91 | */ |
92 | bool QOpcUaDeleteReferenceItem::isForwardReference() const |
93 | { |
94 | return data->isForwardReference; |
95 | } |
96 | |
97 | /*! |
98 | Sets the isForwardReference flag to \a isForwardReference. |
99 | */ |
100 | void QOpcUaDeleteReferenceItem::setIsForwardReference(bool isForwardReference) |
101 | { |
102 | data->isForwardReference = isForwardReference; |
103 | } |
104 | |
105 | /*! |
106 | Returns the reference type id. |
107 | */ |
108 | QString QOpcUaDeleteReferenceItem::referenceTypeId() const |
109 | { |
110 | return data->referenceTypeId; |
111 | } |
112 | |
113 | /*! |
114 | Sets the reference type id to \a referenceTypeId. |
115 | */ |
116 | void QOpcUaDeleteReferenceItem::setReferenceTypeId(const QString &referenceTypeId) |
117 | { |
118 | data->referenceTypeId = referenceTypeId; |
119 | } |
120 | |
121 | /*! |
122 | Returns the source node id. |
123 | */ |
124 | QString QOpcUaDeleteReferenceItem::sourceNodeId() const |
125 | { |
126 | return data->sourceNodeId; |
127 | } |
128 | |
129 | /*! |
130 | Sets the node id of the source node to \a sourceNodeId. |
131 | */ |
132 | void QOpcUaDeleteReferenceItem::setSourceNodeId(const QString &sourceNodeId) |
133 | { |
134 | data->sourceNodeId = sourceNodeId; |
135 | } |
136 | |
137 | QT_END_NAMESPACE |
138 |