1 | // Copyright (C) 2015 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 "qopcuacontentfilterelementresult.h" |
5 | #include <QtCore/qlist.h> |
6 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | /*! |
10 | \class QOpcUaContentFilterElementResult |
11 | \inmodule QtOpcUa |
12 | \brief The OPC UA ContentFilterElementResult. |
13 | |
14 | QOpcUaContentFilterElementResult contains the status code for a |
15 | filter element and all its operands. |
16 | */ |
17 | |
18 | class QOpcUaContentFilterElementResultData : public QSharedData |
19 | { |
20 | public: |
21 | QOpcUa::UaStatusCode statusCode {QOpcUa::UaStatusCode::Good}; |
22 | QList<QOpcUa::UaStatusCode> operandStatusCodes; |
23 | }; |
24 | |
25 | QOpcUaContentFilterElementResult::QOpcUaContentFilterElementResult() |
26 | : data(new QOpcUaContentFilterElementResultData) |
27 | { |
28 | } |
29 | |
30 | /*! |
31 | Constructs a content filter element result from \a rhs. |
32 | */ |
33 | QOpcUaContentFilterElementResult::QOpcUaContentFilterElementResult(const QOpcUaContentFilterElementResult &rhs) |
34 | : data(rhs.data) |
35 | { |
36 | } |
37 | |
38 | /*! |
39 | Sets the values from \a rhs in this content filter element result. |
40 | */ |
41 | QOpcUaContentFilterElementResult &QOpcUaContentFilterElementResult::operator=(const QOpcUaContentFilterElementResult &rhs) |
42 | { |
43 | if (this != &rhs) |
44 | data.operator=(o: rhs.data); |
45 | return *this; |
46 | } |
47 | |
48 | QOpcUaContentFilterElementResult::~QOpcUaContentFilterElementResult() |
49 | { |
50 | } |
51 | |
52 | /*! |
53 | Returns the status code for the filter element. |
54 | */ |
55 | QOpcUa::UaStatusCode QOpcUaContentFilterElementResult::statusCode() const |
56 | { |
57 | return data->statusCode; |
58 | } |
59 | |
60 | /*! |
61 | Sets the status code for the filter element to \a statusCode. |
62 | */ |
63 | void QOpcUaContentFilterElementResult::setStatusCode(QOpcUa::UaStatusCode statusCode) |
64 | { |
65 | data->statusCode = statusCode; |
66 | } |
67 | |
68 | /*! |
69 | Returns the status codes for all filter operands in the order that was used in the filter. |
70 | */ |
71 | QList<QOpcUa::UaStatusCode> QOpcUaContentFilterElementResult::operandStatusCodes() const |
72 | { |
73 | return data->operandStatusCodes; |
74 | } |
75 | |
76 | /*! |
77 | Sets the status codes for all filter operands to \a operandStatusCodes. |
78 | */ |
79 | void QOpcUaContentFilterElementResult::setOperandStatusCodes(const QList<QOpcUa::UaStatusCode> &operandStatusCodes) |
80 | { |
81 | data->operandStatusCodes = operandStatusCodes; |
82 | } |
83 | |
84 | /*! |
85 | Returns a reference to the operand status codes. |
86 | |
87 | \sa operandStatusCodes() |
88 | */ |
89 | QList<QOpcUa::UaStatusCode> &QOpcUaContentFilterElementResult::operandStatusCodesRef() |
90 | { |
91 | return data->operandStatusCodes; |
92 | } |
93 | |
94 | QT_END_NAMESPACE |
95 |