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 QHISTORYREADEVENTREQUEST_H
5#define QHISTORYREADEVENTREQUEST_H
6
7#include <QtOpcUa/qopcuaglobal.h>
8#include <QtOpcUa/qopcuamonitoringparameters.h>
9
10#include <QtCore/qcontainerfwd.h>
11#include <QtCore/qobject.h>
12#include <QtCore/qshareddata.h>
13
14QT_BEGIN_NAMESPACE
15
16class QOpcUaReadItem;
17
18class QDateTime;
19
20class QOpcUaHistoryReadEventRequestData;
21QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QOpcUaHistoryReadEventRequestData, Q_OPCUA_EXPORT)
22class QOpcUaHistoryReadEventRequest
23{
24public:
25 Q_OPCUA_EXPORT QOpcUaHistoryReadEventRequest();
26 Q_OPCUA_EXPORT explicit QOpcUaHistoryReadEventRequest(const QList<QOpcUaReadItem> &nodesToRead,
27 const QDateTime &startTimestamp,
28 const QDateTime &endTimestamp,
29 const QOpcUaMonitoringParameters::EventFilter &filter);
30 Q_OPCUA_EXPORT QOpcUaHistoryReadEventRequest(const QOpcUaHistoryReadEventRequest &other);
31 QOpcUaHistoryReadEventRequest(QOpcUaHistoryReadEventRequest &&other) noexcept = default;
32 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QOpcUaHistoryReadEventRequest)
33 Q_OPCUA_EXPORT QOpcUaHistoryReadEventRequest &operator=(const QOpcUaHistoryReadEventRequest &other);
34 Q_OPCUA_EXPORT ~QOpcUaHistoryReadEventRequest();
35
36 void swap(QOpcUaHistoryReadEventRequest &other) noexcept
37 { data.swap(other&: other.data); }
38
39 Q_OPCUA_EXPORT QDateTime startTimestamp() const;
40 Q_OPCUA_EXPORT void setStartTimestamp(const QDateTime &startTimestamp);
41
42 Q_OPCUA_EXPORT QDateTime endTimestamp() const;
43 Q_OPCUA_EXPORT void setEndTimestamp(const QDateTime &endTimestamp);
44
45 Q_OPCUA_EXPORT quint32 numValuesPerNode() const;
46 Q_OPCUA_EXPORT void setNumValuesPerNode(quint32 numValuesPerNode);
47
48 Q_OPCUA_EXPORT QOpcUaMonitoringParameters::EventFilter filter() const;
49 Q_OPCUA_EXPORT void setFilter(const QOpcUaMonitoringParameters::EventFilter &filter);
50
51 Q_OPCUA_EXPORT QList<QOpcUaReadItem> nodesToRead() const;
52 Q_OPCUA_EXPORT void setNodesToRead(const QList<QOpcUaReadItem> &nodesToRead);
53
54 Q_OPCUA_EXPORT void addNodeToRead(const QOpcUaReadItem &nodeToRead);
55
56private:
57 friend Q_OPCUA_EXPORT bool comparesEqual(const QOpcUaHistoryReadEventRequest &lhs,
58 const QOpcUaHistoryReadEventRequest &rhs) noexcept;
59 friend bool operator==(const QOpcUaHistoryReadEventRequest &lhs,
60 const QOpcUaHistoryReadEventRequest &rhs) noexcept
61 { return comparesEqual(lhs, rhs); }
62 friend bool operator!=(const QOpcUaHistoryReadEventRequest &lhs,
63 const QOpcUaHistoryReadEventRequest &rhs) noexcept
64 {
65 return !(lhs == rhs);
66 }
67
68 QExplicitlySharedDataPointer<QOpcUaHistoryReadEventRequestData> data;
69};
70
71Q_DECLARE_SHARED(QOpcUaHistoryReadEventRequest)
72
73QT_END_NAMESPACE
74
75#endif // QHISTORYREADEVENTREQUEST_H
76

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