ImagingTools Core SDK
TBasePluginComponentImpl.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QString>
7
8
9namespace imtbase
10{
11
12
13template <class ComponentClass, class PluginInterface>
14class TBasePluginComponentImpl: virtual public PluginInterface
15{
16public:
17 TBasePluginComponentImpl(const QString& puginName, const QByteArray& typeId);
18
19 // reimplemented (imtbase::IPluginInfo)
20 virtual QString GetPluginName() const override;
21 virtual QByteArray GetPluginTypeId() const override;
22
23protected:
24 mutable ComponentClass m_component;
25 QString m_pluginName;
26 QByteArray m_pluginTypeId;
27};
28
29
30// public methods
31
32template <class ComponentClass, class PluginInterface>
33TBasePluginComponentImpl<ComponentClass, PluginInterface>::TBasePluginComponentImpl(const QString& pluginName, const QByteArray& typeId)
34 :m_pluginName(pluginName),
35 m_pluginTypeId(typeId)
36{
37}
38
39
40// reimplemented (imtbase::IPluginInfo)
41
42template <class ComponentClass, class PluginInterface>
43QString TBasePluginComponentImpl<ComponentClass, PluginInterface>::GetPluginName() const
44{
45 return m_pluginName;
46}
47
48
49template <class ComponentClass, class PluginInterface>
50QByteArray TBasePluginComponentImpl<ComponentClass, PluginInterface>::GetPluginTypeId() const
51{
52 return m_pluginTypeId;
53}
54
55
56} // namespace imtbase
57
58