1 | // Copyright (C) 2019 The Qt Company Ltd. |
---|---|
2 | // Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com |
3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
4 | |
5 | #include "qopcuaapplicationdescription.h" |
6 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | /*! |
10 | \class QOpcUaApplicationDescription |
11 | \inmodule QtOpcUa |
12 | \brief The OPC UA ApplicationDescription. |
13 | |
14 | The application description contains information about an OPC UA application. |
15 | */ |
16 | |
17 | /*! |
18 | \qmltype ApplicationDescription |
19 | \inqmlmodule QtOpcUa |
20 | \brief The OPC UA ApplicationDescription. |
21 | \since QtOpcUa 5.13 |
22 | |
23 | The application description contains information about an OPC UA application. |
24 | */ |
25 | |
26 | /*! |
27 | \enum QOpcUaApplicationDescription::ApplicationType |
28 | |
29 | This enum type holds the application type. |
30 | |
31 | \value Server This application is a server. |
32 | \value Client This application is a client. |
33 | \value ClientAndServer This application is a client and a server. |
34 | \value DiscoveryServer This application is a discovery server. |
35 | */ |
36 | |
37 | /*! |
38 | \qmlproperty enumeration ApplicationDescription::ApplicationType |
39 | |
40 | The application type. |
41 | |
42 | \value Server This application is a server. |
43 | \value Client This application is a client. |
44 | \value ClientAndServer This application is a client and a server. |
45 | \value DiscoveryServer This application is a discovery server. |
46 | */ |
47 | |
48 | /*! |
49 | \property QOpcUaApplicationDescription::applicationName |
50 | |
51 | Name describing the application. |
52 | */ |
53 | |
54 | /*! |
55 | \qmlproperty LocalizedText ApplicationDescription::applicationName |
56 | |
57 | Name describing the application. |
58 | */ |
59 | |
60 | /*! |
61 | \property QOpcUaApplicationDescription::applicationType |
62 | |
63 | The application's type: server, client, both, or discovery server. |
64 | */ |
65 | |
66 | /*! |
67 | \qmlproperty ApplicationType ApplicationDescription::applicationType |
68 | |
69 | The application's type: server, client, both, or discovery server. |
70 | */ |
71 | |
72 | /*! |
73 | \property QOpcUaApplicationDescription::applicationUri |
74 | |
75 | The globally unique identifier for this application instance. |
76 | */ |
77 | |
78 | /*! |
79 | \qmlproperty string ApplicationDescription::applicationUri |
80 | |
81 | The globally unique identifier for this application instance. |
82 | */ |
83 | |
84 | /*! |
85 | \property QOpcUaApplicationDescription::discoveryProfileUri |
86 | |
87 | The URI of the supported discovery profile. |
88 | */ |
89 | |
90 | /*! |
91 | \qmlproperty string ApplicationDescription::discoveryProfileUri |
92 | |
93 | The URI of the supported discovery profile. |
94 | */ |
95 | |
96 | /*! |
97 | \property QOpcUaApplicationDescription::discoveryUrls |
98 | |
99 | A list of URLs of discovery endpoints. |
100 | */ |
101 | |
102 | /*! |
103 | \qmlproperty list ApplicationDescription::discoveryUrls |
104 | |
105 | A list of URLs of discovery endpoints. |
106 | */ |
107 | |
108 | /*! |
109 | \property QOpcUaApplicationDescription::gatewayServerUri |
110 | |
111 | The URI of the gateway server. |
112 | */ |
113 | |
114 | /*! |
115 | \qmlproperty string ApplicationDescription::gatewayServerUri |
116 | |
117 | The URI of the gateway server. |
118 | */ |
119 | |
120 | /*! |
121 | \property QOpcUaApplicationDescription::productUri |
122 | |
123 | The globally unique identifier for this product. |
124 | */ |
125 | |
126 | /*! |
127 | \qmlproperty string ApplicationDescription::productUri |
128 | |
129 | The globally unique identifier for this product. |
130 | */ |
131 | |
132 | class QOpcUaApplicationDescriptionData : public QSharedData |
133 | { |
134 | public: |
135 | QString applicationUri; |
136 | QString productUri; |
137 | QOpcUaLocalizedText applicationName; |
138 | QOpcUaApplicationDescription::ApplicationType applicationType{QOpcUaApplicationDescription::ApplicationType::Server}; |
139 | QString gatewayServerUri; |
140 | QString discoveryProfileUri; |
141 | QList<QString> discoveryUrls; |
142 | }; |
143 | |
144 | /*! |
145 | Default constructs an application description with no parameters set. |
146 | */ |
147 | QOpcUaApplicationDescription::QOpcUaApplicationDescription() |
148 | : data(new QOpcUaApplicationDescriptionData) |
149 | { |
150 | } |
151 | |
152 | /*! |
153 | Constructs an application description from \a other. |
154 | */ |
155 | QOpcUaApplicationDescription::QOpcUaApplicationDescription(const QOpcUaApplicationDescription &other) |
156 | : data(other.data) |
157 | { |
158 | } |
159 | |
160 | /*! |
161 | Sets the values from \a other in this application description. |
162 | */ |
163 | QOpcUaApplicationDescription &QOpcUaApplicationDescription::operator=(const QOpcUaApplicationDescription &other) |
164 | { |
165 | this->data = other.data; |
166 | return *this; |
167 | } |
168 | |
169 | /*! |
170 | Returns \c true if this application description has the same value as \a rhs. |
171 | */ |
172 | bool QOpcUaApplicationDescription::operator==(const QOpcUaApplicationDescription &rhs) const |
173 | { |
174 | return rhs.productUri() == productUri() && |
175 | rhs.discoveryUrls() == discoveryUrls() && |
176 | rhs.applicationUri() == applicationUri() && |
177 | rhs.applicationName() == applicationName() && |
178 | rhs.applicationType() == applicationType() && |
179 | rhs.gatewayServerUri() == gatewayServerUri() && |
180 | rhs.discoveryProfileUri() == rhs.discoveryProfileUri(); |
181 | } |
182 | |
183 | QOpcUaApplicationDescription::~QOpcUaApplicationDescription() |
184 | { |
185 | } |
186 | |
187 | /*! |
188 | Returns a list of URLs of discovery endpoints. |
189 | */ |
190 | QList<QString> QOpcUaApplicationDescription::discoveryUrls() const |
191 | { |
192 | return data->discoveryUrls; |
193 | } |
194 | |
195 | /*! |
196 | Returns a reference to a list of URLs of discovery endpoints. |
197 | */ |
198 | QList<QString> &QOpcUaApplicationDescription::discoveryUrlsRef() |
199 | { |
200 | return data->discoveryUrls; |
201 | } |
202 | |
203 | /*! |
204 | Sets the discovery URLs to \a discoveryUrls. |
205 | */ |
206 | void QOpcUaApplicationDescription::setDiscoveryUrls(const QList<QString> &discoveryUrls) |
207 | { |
208 | data->discoveryUrls = discoveryUrls; |
209 | } |
210 | |
211 | /*! |
212 | Returns the URI of the supported discovery profile. |
213 | */ |
214 | QString QOpcUaApplicationDescription::discoveryProfileUri() const |
215 | { |
216 | return data->discoveryProfileUri; |
217 | } |
218 | |
219 | /*! |
220 | Sets the discovery profile URI to \a discoveryProfileUri. |
221 | */ |
222 | void QOpcUaApplicationDescription::setDiscoveryProfileUri(const QString &discoveryProfileUri) |
223 | { |
224 | data->discoveryProfileUri = discoveryProfileUri; |
225 | } |
226 | |
227 | /*! |
228 | Returns the URI of the gateway server. |
229 | */ |
230 | QString QOpcUaApplicationDescription::gatewayServerUri() const |
231 | { |
232 | return data->gatewayServerUri; |
233 | } |
234 | |
235 | /*! |
236 | Sets the URI of the gateway server to \a gatewayServerUri. |
237 | */ |
238 | void QOpcUaApplicationDescription::setGatewayServerUri(const QString &gatewayServerUri) |
239 | { |
240 | data->gatewayServerUri = gatewayServerUri; |
241 | } |
242 | |
243 | /*! |
244 | Returns the application's type (server, client, both, discovery server). |
245 | */ |
246 | QOpcUaApplicationDescription::ApplicationType QOpcUaApplicationDescription::applicationType() const |
247 | { |
248 | return data->applicationType; |
249 | } |
250 | |
251 | /*! |
252 | Sets the application type to \a applicationType. |
253 | */ |
254 | void QOpcUaApplicationDescription::setApplicationType(ApplicationType applicationType) |
255 | { |
256 | data->applicationType = applicationType; |
257 | } |
258 | |
259 | /*! |
260 | Returns a name describing the application. |
261 | */ |
262 | QOpcUaLocalizedText QOpcUaApplicationDescription::applicationName() const |
263 | { |
264 | return data->applicationName; |
265 | } |
266 | |
267 | /*! |
268 | Sets the application name to \a applicationName. |
269 | */ |
270 | void QOpcUaApplicationDescription::setApplicationName(const QOpcUaLocalizedText &applicationName) |
271 | { |
272 | data->applicationName = applicationName; |
273 | } |
274 | |
275 | /*! |
276 | Returns the globally unique identifier for this product. |
277 | */ |
278 | QString QOpcUaApplicationDescription::productUri() const |
279 | { |
280 | return data->productUri; |
281 | } |
282 | |
283 | /*! |
284 | Sets the globally unique identifier for this product to \a productUri. |
285 | */ |
286 | void QOpcUaApplicationDescription::setProductUri(const QString &productUri) |
287 | { |
288 | data->productUri = productUri; |
289 | } |
290 | |
291 | /*! |
292 | Returns the globally unique identifier for this application instance. |
293 | */ |
294 | QString QOpcUaApplicationDescription::applicationUri() const |
295 | { |
296 | return data->applicationUri; |
297 | } |
298 | |
299 | /*! |
300 | Sets the globally unique identifier for this application instance to \a applicationUri. |
301 | */ |
302 | void QOpcUaApplicationDescription::setApplicationUri(const QString &applicationUri) |
303 | { |
304 | data->applicationUri = applicationUri; |
305 | } |
306 | |
307 | QT_END_NAMESPACE |
308 |
Definitions
- QOpcUaApplicationDescriptionData
- QOpcUaApplicationDescription
- QOpcUaApplicationDescription
- operator=
- operator==
- ~QOpcUaApplicationDescription
- discoveryUrls
- discoveryUrlsRef
- setDiscoveryUrls
- discoveryProfileUri
- setDiscoveryProfileUri
- gatewayServerUri
- setGatewayServerUri
- applicationType
- setApplicationType
- applicationName
- setApplicationName
- productUri
- setProductUri
- applicationUri
Learn Advanced QML with KDAB
Find out more