18template <
class Attribute>
25 const QString& description,
26 const Attribute* defaultValuePtr,
32 virtual void AddRelatedMetaId(
int metaGroupId,
const QByteArray&
id,
int flags)
override;
45 QString m_description;
46 const Attribute* m_defaultValuePtr;
49 typedef QMap<QByteArray, int> IdsToFlagsMap;
50 typedef QMap<int, IdsToFlagsMap> RelatedIdsMap;
51 RelatedIdsMap m_relatedInterfacesMap;
57template <
class Attribute>
61 const QString& description,
62 const Attribute* defaultValuePtr,
66 m_description(description),
67 m_defaultValuePtr(defaultValuePtr),
68 m_attributeFlags(flags)
70 if (relatedInterfaceInfo.
IsValid() && !relatedInterfaceInfo.
IsVoid()){
80template <
class Attribute>
87template <
class Attribute>
90 IdsToFlagsMap& groupMap = m_relatedInterfacesMap[metaGroupId];
92 IdsToFlagsMap::iterator foundIter = groupMap.find(
id);
93 if (foundIter != groupMap.end()){
94 Q_ASSERT((flags & (AF_REFERENCE | AF_FACTORY)) == (foundIter.value() & (AF_REFERENCE | AF_FACTORY)));
96 foundIter.value() |= flags & AF_OBLIGATORY;
97 foundIter.value() &= flags | ~AF_NULLABLE;
100 groupMap[id] = flags;
104 m_attributeFlags |= flags & AF_OBLIGATORY;
105 m_attributeFlags &= flags | ~AF_NULLABLE;
112template <
class Attribute>
117 RelatedIdsMap::ConstIterator foundGroupIter = m_relatedInterfacesMap.constFind(metaGroupId);
118 if (foundGroupIter != m_relatedInterfacesMap.constEnd()){
119 const IdsToFlagsMap& groupMap = foundGroupIter.value();
121 for ( IdsToFlagsMap::const_iterator iter = groupMap.begin();
122 iter != groupMap.end();
124 const QByteArray&
id = iter.key();
125 int idFlags = iter.value();
127 if (((idFlags & flagsMask) == flags)){
139template <
class Attribute>
142 return m_description;
146template <
class Attribute>
149 return m_defaultValuePtr;
153template <
class Attribute>
156 return Attribute::GetTypeName();
160template <
class Attribute>
163 return m_attributeFlags;
Standard implementation of static info for base component classes.
virtual void RegisterAttributeInfo(const QByteArray &attributeId, const IAttributeStaticInfo *attributeInfoPtr)
Register static attribute info.
@ MGI_INTERFACES
ID of meta group storing list of supported interfaces.
Interface adding to attribute static info functionality existing only for real attributes.
virtual const QByteArray & GetAttributeId() const override
Get ID of this attribute.
virtual QByteArray GetAttributeTypeId() const override
Return attribute type ID.
virtual int GetAttributeFlags() const override
Get flags of this attribute.
virtual void AddRelatedMetaId(int metaGroupId, const QByteArray &id, int flags) override
Add related interface to this attribute info.
virtual const iser::IObject * GetAttributeDefaultValue() const override
Get default attribute value.
virtual IElementStaticInfo::Ids GetRelatedMetaIds(int metaGroupId, int flags, int flagsMask) const override
Get related meta information.
TAttributeStaticInfo(icomp::CBaseComponentStaticInfo &staticInfo, const QByteArray &id, const QString &description, const Attribute *defaultValuePtr, int flags, const istd::CClassInfo &relatedInterfaceInfo)
virtual QString GetAttributeDescription() const override
Get description of this attribute.
Common interface for factorisable model objects.
Represents platform independent type info and provide set of static class manipulation functions.
const QByteArray & GetName() const
Get undecorated and platform undependent class name.
bool IsValid() const
Check if this class info object is valid.
bool IsVoid() const
Check if this class information represents void type.
Package with interfaces and class used for components concept.