open62541pp
0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
include
open62541pp
plugin
pluginadapter.hpp
Go to the documentation of this file.
1
#pragma once
2
3
namespace
opcua
{
4
5
/**
6
* Base class to implement plugin adapters.
7
*
8
* Plugin adapters will provide a different (modern) interface for open62541's native plugins.
9
* For example AccessControlBase is the plugin adapter for UA_AccessControl.
10
*
11
* The native plugin is created via the PluginAdapter::create function.
12
* Usually, the native plugin carries a `void* context` pointer which will refer back to the plugin
13
* adapter. Either move the adapter ownership to the plugin with `ownsAdapter = true` or make sure
14
* that the plugin adapter outlives the native plugin to avoid dangling pointers.
15
*
16
* @tparam T Type of the native plugin, e.g. UA_AccessControl
17
*/
18
template
<
typename
T>
19
class
PluginAdapter
{
20
public
:
21
using
PluginType
= T;
22
23
PluginAdapter
() =
default
;
24
virtual
~PluginAdapter
() =
default
;
25
26
PluginAdapter
(
const
PluginAdapter
&) =
default
;
27
PluginAdapter
(
PluginAdapter
&&) noexcept = default;
28
PluginAdapter
& operator=(const
PluginAdapter
&) = default;
29
PluginAdapter
& operator=(
PluginAdapter
&&) noexcept = default;
30
31
virtual T
create
(
bool
ownsAdapter) = 0;
32
};
33
34
}
// namespace opcua
opcua::PluginAdapter
Base class to implement plugin adapters.
Definition
pluginadapter.hpp:19
opcua::PluginAdapter::create
virtual T create(bool ownsAdapter)=0
opcua::PluginAdapter::PluginAdapter
PluginAdapter(PluginAdapter &&) noexcept=default
opcua::PluginAdapter::PluginType
T PluginType
Definition
pluginadapter.hpp:21
opcua::PluginAdapter::~PluginAdapter
virtual ~PluginAdapter()=default
opcua::PluginAdapter::PluginAdapter
PluginAdapter(const PluginAdapter &)=default
opcua::PluginAdapter::PluginAdapter
PluginAdapter()=default
opcua
Definition
async.hpp:11
Generated by
1.11.0