| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
|---|---|
| 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 QOPCUA_OPCUAATTRIBUTECACHE_P_H |
| 5 | #define QOPCUA_OPCUAATTRIBUTECACHE_P_H |
| 6 | |
| 7 | #include "qopcuatype.h" |
| 8 | #include <QtCore/qobject.h> |
| 9 | #include <private/qglobal_p.h> |
| 10 | #include <QtCore/qhash.h> |
| 11 | |
| 12 | // |
| 13 | // W A R N I N G |
| 14 | // ------------- |
| 15 | // |
| 16 | // This file is not part of the Qt API. It exists purely as an |
| 17 | // implementation detail. This header file may change from version to |
| 18 | // version without notice, or even be removed. |
| 19 | // |
| 20 | // We mean it. |
| 21 | // |
| 22 | |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class OpcUaAttributeValue; |
| 27 | |
| 28 | class OpcUaAttributeCache : public QObject |
| 29 | { |
| 30 | Q_OBJECT |
| 31 | public: |
| 32 | explicit OpcUaAttributeCache(QObject *parent = nullptr); |
| 33 | OpcUaAttributeValue *attribute(QOpcUa::NodeAttribute attribute); |
| 34 | const QVariant &attributeValue(QOpcUa::NodeAttribute); |
| 35 | |
| 36 | public slots: |
| 37 | void setAttributeValue(QOpcUa::NodeAttribute attribute, const QVariant &value); |
| 38 | void invalidate(); |
| 39 | |
| 40 | private: |
| 41 | QHash<QOpcUa::NodeAttribute, OpcUaAttributeValue *> m_attributeCache; |
| 42 | }; |
| 43 | |
| 44 | QT_END_NAMESPACE |
| 45 | |
| 46 | #endif // QOPCUA_OPCUAATTRIBUTECACHE_P_H |
| 47 |
