ICF 3.1.1.10
Technical documentation of ICF Libraries
CBaseComponentStaticInfo.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
11
12
13namespace icomp
14{
15
16
23 virtual public IRealComponentStaticInfo
24{
25public:
27 typedef void* (*InterfaceExtractorPtr)(IComponent& component);
28
30
31 explicit CBaseComponentStaticInfo(const IRealComponentStaticInfo* baseComponentPtr = nullptr);
32
38 virtual void RegisterInterfaceExtractor(const QByteArray& interfaceName, InterfaceExtractorPtr extractorPtr);
45 virtual void RegisterAttributeInfo(const QByteArray& attributeId, const IAttributeStaticInfo* attributeInfoPtr);
52 virtual void RegisterSubelementInfo(const QByteArray& subcomponentId, const IElementStaticInfo* staticInfoPtr);
53
54 // reimplemented (icomp::IRealComponentStaticInfo)
55 std::unique_ptr<IComponent> CreateComponent() const override;
56
57 // reimplemented (icomp::IComponentInterfaceExtractor)
59 const istd::CClassInfo& interfaceType,
60 IComponent& component,
61 const QByteArray& subId) const override;
62
63 // reimplemented (icomp::IComponentStaticInfo)
64 const IAttributeStaticInfo* GetAttributeInfo(const QByteArray& attributeId) const override;
65
66 // reimplemented (icomp::IElementStaticInfo)
67 Ids GetMetaIds(MetaGroupId metaGroupId) const override;
68 const IElementStaticInfo* GetSubelementInfo(const QByteArray& subcomponentId) const override;
69
70 // reimplemented (iattr::IAttributesMetaInfoProvider)
72 const iattr::IAttributeMetaInfo* GetAttributeMetaInfo(const QByteArray& attributeId) const override;
73
74private:
75 const IRealComponentStaticInfo* m_baseComponentPtr;
76
77 typedef QMap<QByteArray, InterfaceExtractorPtr> InterfaceExtractors;
78 InterfaceExtractors m_interfaceExtractors;
79
80 typedef QMap<QByteArray, const IElementStaticInfo*> SubelementInfos;
81 SubelementInfos m_subelementInfos;
82
83 typedef QMap<QByteArray, const IAttributeStaticInfo*> AttributeInfos;
84 AttributeInfos m_attributeInfos;
85};
86
87
88} // namespace icomp
89
90
Meta information describing single attribute.
Standard implementation of static info for base component classes.
Ids GetMetaIds(MetaGroupId metaGroupId) const override
Get list of meta IDs associated with some meta key.
const iattr::IAttributeMetaInfo * GetAttributeMetaInfo(const QByteArray &attributeId) const override
Get property with the given index.
CBaseComponentStaticInfo(const IRealComponentStaticInfo *baseComponentPtr=nullptr)
void *(*) InterfaceExtractorPtr(IComponent &component)
virtual void RegisterSubelementInfo(const QByteArray &subcomponentId, const IElementStaticInfo *staticInfoPtr)
Register static subcomponent info.
static istd::CClassInfo s_compInterfaceType
iattr::IAttributesProvider::AttributeIds GetAttributeMetaIds() const override
Get all IDs of known attribute meta informations.
const IElementStaticInfo * GetSubelementInfo(const QByteArray &subcomponentId) const override
Return number of interfaces for specific slot.
virtual void RegisterAttributeInfo(const QByteArray &attributeId, const IAttributeStaticInfo *attributeInfoPtr)
Register static attribute info.
void * GetComponentInterface(const istd::CClassInfo &interfaceType, IComponent &component, const QByteArray &subId) const override
Extract instance implemented specified interface from some component.
std::unique_ptr< IComponent > CreateComponent() const override
Create component instance.
const IAttributeStaticInfo * GetAttributeInfo(const QByteArray &attributeId) const override
Get set of attributes.
virtual void RegisterInterfaceExtractor(const QByteArray &interfaceName, InterfaceExtractorPtr extractorPtr)
Register interface ID for this static component info.
Describe component attribute static information.
Main component interface.
Definition IComponent.h:35
This interface provide static information about element meta info.
Interface adding to component static info functionality existing only for real components.
Represents platform independent type info and provide set of static class manipulation functions.
Definition CClassInfo.h:27
Package with interfaces and class used for components concept.

© Witold Gantzke and Kirill Lepskiy