ICF 3.0.5.47
Technical documentation of ICF Libraries
TComponentRegistrator.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QByteArray>
11
12// ICF includes
15
16
17namespace icomp
18{
19
20
24template <class Component>
26{
27public:
29
31 const QByteArray& componentId,
32 CPackageStaticInfo& packageStaticInfo,
33 const QString& description,
34 const QString& keywords);
35
36 // reimplemented (icomp::IComponentStaticInfo)
37 virtual const QString& GetDescription() const;
38 virtual const QString& GetKeywords() const;
39
40private:
41 QByteArray m_logicalName;
42 QString m_description;
43 QString m_keywords;
44};
45
46
47// public methods
48
49template <class Component>
51 const QByteArray& componentId,
52 CPackageStaticInfo& packageStaticInfo,
53 const QString& description,
54 const QString& keywords)
55: BaseClass(&Component::InitStaticInfo(nullptr)),
56 m_description(description),
57 m_keywords(keywords)
58{
59 packageStaticInfo.RegisterEmbeddedComponentInfo(componentId, this);
60
61 m_keywords += " ";
62
63 m_keywords += packageStaticInfo.GetKeywords();
64}
65
66
67// reimplemented (icomp::IComponentStaticInfo)
68
69template <class Component>
71{
72 return m_description;
73}
74
75
76template <class Component>
78{
79 return m_keywords;
80}
81
82
83} // namespace icomp
84
85
Static info for component package.
const QString & GetKeywords() const override
Get keywords for this component.
virtual void RegisterEmbeddedComponentInfo(const QByteArray &embeddedId, const IComponentStaticInfo *componentInfoPtr)
Register embedded component static info.
Simple helper class providing registration of template-specified component in package.
TComponentStaticInfo< Component > BaseClass
virtual const QString & GetDescription() const
Get human readable description of this component.
TComponentRegistrator(const QByteArray &componentId, CPackageStaticInfo &packageStaticInfo, const QString &description, const QString &keywords)
virtual const QString & GetKeywords() const
Get keywords for this component.
Package with interfaces and class used for components concept.

© Witold Gantzke and Kirill Lepskiy