1// Copyright (C) 2017 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#include "qopen62541client.h"
5#include "qopen62541node.h"
6#include "qopen62541plugin.h"
7#include "qopen62541valueconverter.h"
8#include <QtOpcUa/qopcuaclient.h>
9
10#include <QtCore/qloggingcategory.h>
11
12QT_BEGIN_NAMESPACE
13
14static void compileTimeEnforceEnumMappings(void)
15{
16 static_assert(static_cast<QOpcUa::NodeClass>(UA_NODECLASS_UNSPECIFIED) == QOpcUa::NodeClass::Undefined,
17 "open62541 and QOpcUa values for NodeClasses must be the same");
18 static_assert(static_cast<QOpcUa::NodeClass>(UA_NODECLASS_VARIABLE) == QOpcUa::NodeClass::Variable,
19 "open62541 and QOpcUa values for NodeClasses must be the same");
20}
21
22QOpen62541Plugin::QOpen62541Plugin(QObject *parent)
23 : QOpcUaPlugin(parent)
24{
25 compileTimeEnforceEnumMappings();
26 qRegisterMetaType<UA_NodeId>();
27}
28
29QOpen62541Plugin::~QOpen62541Plugin()
30{
31}
32
33QOpcUaClient *QOpen62541Plugin::createClient(const QVariantMap &backendProperties)
34{
35 Q_UNUSED(backendProperties)
36 return new QOpcUaClient(new QOpen62541Client(backendProperties));
37}
38
39Q_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_OPEN62541, "qt.opcua.plugins.open62541")
40
41QT_END_NAMESPACE
42

source code of qtopcua/src/plugins/opcua/open62541/qopen62541plugin.cpp