| 1 | // Copyright (C) 2019 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 QHISTORYREADRAWREQUEST_H | 
| 5 | #define QHISTORYREADRAWREQUEST_H | 
| 6 |  | 
| 7 | #include <QtCore/qobject.h> | 
| 8 | #include <QtCore/qdatetime.h> | 
| 9 | #include <QtCore/qshareddata.h> | 
| 10 |  | 
| 11 | #include <QtOpcUa/qopcuareaditem.h> | 
| 12 | #include <QtOpcUa/qopcuahistorydata.h> | 
| 13 |  | 
| 14 | #include <QtOpcUa/qopcuaglobal.h> | 
| 15 |  | 
| 16 | QT_BEGIN_NAMESPACE | 
| 17 |  | 
| 18 | class QOpcUaHistoryReadRawRequestData; | 
| 19 | class Q_OPCUA_EXPORT QOpcUaHistoryReadRawRequest | 
| 20 | { | 
| 21 | public: | 
| 22 |     QOpcUaHistoryReadRawRequest(); | 
| 23 |     explicit QOpcUaHistoryReadRawRequest(const QList<QOpcUaReadItem> &nodesToRead, | 
| 24 |                                          const QDateTime &startTimestamp, | 
| 25 |                                          const QDateTime &endTimestamp, | 
| 26 |                                          quint32 numValuesPerNode = 0, | 
| 27 |                                          bool returnBounds = false); | 
| 28 |  | 
| 29 |     explicit QOpcUaHistoryReadRawRequest(const QList<QOpcUaReadItem> &nodesToRead, | 
| 30 |                                          const QDateTime &startTimestamp, | 
| 31 |                                          const QDateTime &endTimestamp, | 
| 32 |                                          QOpcUa::TimestampsToReturn timestampsToReturn); | 
| 33 |  | 
| 34 |     QOpcUaHistoryReadRawRequest(const QOpcUaHistoryReadRawRequest &other); | 
| 35 |     ~QOpcUaHistoryReadRawRequest(); | 
| 36 |  | 
| 37 |     void swap(QOpcUaHistoryReadRawRequest &other) noexcept | 
| 38 |     { data.swap(other&: other.data); } | 
| 39 |  | 
| 40 |     QDateTime startTimestamp() const; | 
| 41 |     void setStartTimestamp(const QDateTime &startTimestamp); | 
| 42 |  | 
| 43 |     QDateTime endTimestamp() const; | 
| 44 |     void setEndTimestamp(const QDateTime &endTimestamp); | 
| 45 |  | 
| 46 |     quint32 numValuesPerNode() const; | 
| 47 |     void setNumValuesPerNode(quint32 numValuesPerNode); | 
| 48 |  | 
| 49 |     bool returnBounds() const; | 
| 50 |     void setReturnBounds(bool returnBounds); | 
| 51 |  | 
| 52 |     QOpcUa::TimestampsToReturn timestampsToReturn() const; | 
| 53 |     void setTimestampsToReturn(QOpcUa::TimestampsToReturn timestampsToReturn); | 
| 54 |  | 
| 55 |     QList<QOpcUaReadItem> nodesToRead() const; | 
| 56 |     void setNodesToRead(const QList<QOpcUaReadItem> &nodesToRead); | 
| 57 |  | 
| 58 |     void addNodeToRead(const QOpcUaReadItem &nodeToRead); | 
| 59 |  | 
| 60 |     QOpcUaHistoryReadRawRequest &operator=(const QOpcUaHistoryReadRawRequest &other); | 
| 61 |  | 
| 62 | private: | 
| 63 |     QSharedDataPointer<QOpcUaHistoryReadRawRequestData> data; | 
| 64 |  | 
| 65 |     friend Q_OPCUA_EXPORT bool operator==(const QOpcUaHistoryReadRawRequest &lhs, | 
| 66 |                                           const QOpcUaHistoryReadRawRequest &rhs) noexcept; | 
| 67 |     friend inline bool operator!=(const QOpcUaHistoryReadRawRequest &lhs, | 
| 68 |                                   const QOpcUaHistoryReadRawRequest &rhs) noexcept | 
| 69 |     { | 
| 70 |         return !(lhs == rhs); | 
| 71 |     } | 
| 72 | }; | 
| 73 |  | 
| 74 | Q_DECLARE_SHARED(QOpcUaHistoryReadRawRequest) | 
| 75 |  | 
| 76 | QT_END_NAMESPACE | 
| 77 |  | 
| 78 | Q_DECLARE_METATYPE(QOpcUaHistoryReadRawRequest) | 
| 79 |  | 
| 80 | #endif // QHISTORYREADRAWREQUEST_H | 
| 81 |  |