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

source code of qtopcua/src/declarative_opcua/opcuaattributecache_p.h