ACF $AcfVersion:0$
TComponentRegistrator.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QByteArray>
7
8// ACF includes
11
12
13namespace icomp
14{
15
16
20template <class Component>
22{
23public:
25
27 const QByteArray& componentId,
28 icomp::CPackageStaticInfo& packageStaticInfo,
29 const QString& description,
30 const QString& keywords);
31
32 // reimplemented (icomp::IComponentStaticInfo)
33 virtual const QString& GetDescription() const override;
34 virtual const QString& GetKeywords() const override;
35
36private:
37 QByteArray m_logicalName;
38 QString m_description;
39 QString m_keywords;
40};
41
42
43// public methods
44
45template <class Component>
47 const QByteArray& componentId,
48 icomp::CPackageStaticInfo& packageStaticInfo,
49 const QString& description,
50 const QString& keywords)
51: BaseClass(&Component::InitStaticInfo(NULL)),
52 m_description(description),
53 m_keywords(keywords)
54{
55 packageStaticInfo.RegisterEmbeddedComponentInfo(componentId, this);
56
57 m_keywords += " ";
58
59 m_keywords += packageStaticInfo.GetKeywords();
60}
61
62
63// reimplemented (icomp::IComponentStaticInfo)
64
65template <class Component>
67{
68 return m_description;
69}
70
71
72template <class Component>
74{
75 return m_keywords;
76}
77
78
79} // namespace icomp
80
81
Static info for component package.
virtual void RegisterEmbeddedComponentInfo(const QByteArray &embeddedId, const IComponentStaticInfo *componentInfoPtr)
Register embedded component static info.
virtual const QString & GetKeywords() const override
Get keywords for this component.
Simple helper class providing registration of template-specified component in package.
virtual const QString & GetDescription() const override
Get human readable description of this component.
TComponentRegistrator(const QByteArray &componentId, icomp::CPackageStaticInfo &packageStaticInfo, const QString &description, const QString &keywords)
icomp::TComponentStaticInfo< Component > BaseClass
virtual const QString & GetKeywords() const override
Get keywords for this component.
#define NULL
Definition istd.h:74
Package with interfaces and class used for components concept.