CBaseComponentStaticInfo.h
Go to the documentation of this file.
1 #ifndef icomp_CBaseComponentStaticInfo_included
2 #define icomp_CBaseComponentStaticInfo_included
3 
4 
7 
8 
9 namespace icomp
10 {
11 
12 
19  virtual public IRealComponentStaticInfo
20 {
21 public:
23  typedef void* (*InterfaceExtractorPtr)(IComponent& component);
24 
26 
27  explicit CBaseComponentStaticInfo(const IRealComponentStaticInfo* baseComponentPtr = NULL);
28 
34  virtual void RegisterInterfaceExtractor(const QByteArray& interfaceName, InterfaceExtractorPtr extractorPtr);
41  virtual void RegisterAttributeInfo(const QByteArray& attributeId, const IAttributeStaticInfo* attributeInfoPtr);
48  virtual void RegisterSubelementInfo(const QByteArray& subcomponentId, const IElementStaticInfo* staticInfoPtr);
49 
50  // reimplemented (icomp::IRealComponentStaticInfo)
51  virtual IComponent* CreateComponent() const;
52 
53  // reimplemented (icomp::IComponentInterfaceExtractor)
54  virtual void* GetComponentInterface(
55  const istd::CClassInfo& interfaceType,
56  IComponent& component,
57  const QByteArray& subId) const;
58 
59  // reimplemented (icomp::IComponentStaticInfo)
60  virtual const IAttributeStaticInfo* GetAttributeInfo(const QByteArray& attributeId) const;
61 
62  // reimplemented (icomp::IElementStaticInfo)
63  virtual Ids GetMetaIds(int metaGroupId) const;
64  virtual const IElementStaticInfo* GetSubelementInfo(const QByteArray& subcomponentId) const;
65 
66  // reimplemented (iattr::IAttributesMetaInfoProvider)
68  virtual const iattr::IAttributeMetaInfo* GetAttributeMetaInfo(const QByteArray& attributeId) const;
69 
70 private:
71  const IRealComponentStaticInfo* m_baseComponentPtr;
72 
73  typedef QMap<QByteArray, InterfaceExtractorPtr> InterfaceExtractors;
74  InterfaceExtractors m_interfaceExtractors;
75 
76  typedef QMap<QByteArray, const IElementStaticInfo*> SubelementInfos;
77  SubelementInfos m_subelementInfos;
78 
79  typedef QMap<QByteArray, const IAttributeStaticInfo*> AttributeInfos;
80  AttributeInfos m_attributeInfos;
81 };
82 
83 
84 } // namespace icomp
85 
86 
87 #endif // !icomp_CBaseComponentStaticInfo_included
88 
89 
virtual IComponent * CreateComponent() const
Create component instance.
virtual const IAttributeStaticInfo * GetAttributeInfo(const QByteArray &attributeId) const
Get set of attributes.
virtual void * GetComponentInterface(const istd::CClassInfo &interfaceType, IComponent &component, const QByteArray &subId) const
Extract instance implemented specified interface from some component.
virtual Ids GetMetaIds(int metaGroupId) const
Get list of meta IDs associated with some meta key.
void *(* InterfaceExtractorPtr)(IComponent &component)
CBaseComponentStaticInfo(const IRealComponentStaticInfo *baseComponentPtr=NULL)
Main component interface.
Definition: IComponent.h:31
virtual void RegisterAttributeInfo(const QByteArray &attributeId, const IAttributeStaticInfo *attributeInfoPtr)
Register static attribute info.
Standard implementation of static info for base component classes.
static istd::CClassInfo s_compInterfaceType
Interface adding to component static info functionality existing only for real components.
virtual const iattr::IAttributeMetaInfo * GetAttributeMetaInfo(const QByteArray &attributeId) const
Get property with the given index.
QSet< QByteArray > AttributeIds
#define NULL
Definition: istd.h:64
virtual void RegisterInterfaceExtractor(const QByteArray &interfaceName, InterfaceExtractorPtr extractorPtr)
Register interface ID for this static component info.
virtual void RegisterSubelementInfo(const QByteArray &subcomponentId, const IElementStaticInfo *staticInfoPtr)
Register static subcomponent info.
Represents platform independent type info and provide set of static class manipulation functions...
Definition: CClassInfo.h:22
virtual iattr::IAttributesProvider::AttributeIds GetAttributeMetaIds() const
Get all IDs of known attribute meta informations.
virtual const IElementStaticInfo * GetSubelementInfo(const QByteArray &subcomponentId) const
Return number of interfaces for specific slot.
Describe component attribute static information.
This interface provide static information about element meta info.
Meta information describing single attribute.

© 2007-2017 Witold Gantzke and Kirill Lepskiy