23template <
class Attribute>
30 const QString& description,
31 const Attribute* defaultValuePtr,
50 QString m_description;
51 const Attribute* m_defaultValuePtr;
54 typedef QMap<QByteArray, int> IdsToFlagsMap;
55 typedef QMap<IElementStaticInfo::MetaGroupId, IdsToFlagsMap> RelatedIdsMap;
56 RelatedIdsMap m_relatedInterfacesMap;
62template <
class Attribute>
66 const QString& description,
67 const Attribute* defaultValuePtr,
71 m_description(description),
72 m_defaultValuePtr(defaultValuePtr),
73 m_attributeFlags(flags)
75 if (relatedInterfaceInfo.
IsValid() && !relatedInterfaceInfo.
IsVoid()){
76 m_relatedInterfacesMap[IElementStaticInfo::MetaGroupId::Interfaces][relatedInterfaceInfo.GetName()] = flags;
85template <
class Attribute>
92template <
class Attribute>
95 IdsToFlagsMap& groupMap = m_relatedInterfacesMap[metaGroupId];
97 IdsToFlagsMap::iterator foundIter = groupMap.find(
id);
98 if (foundIter != groupMap.end()){
99 Q_ASSERT((flags & (AF_REFERENCE | AF_FACTORY)) == (foundIter.value() & (AF_REFERENCE | AF_FACTORY)));
101 foundIter.value() |= flags & AF_OBLIGATORY;
102 foundIter.value() &= flags | ~AF_NULLABLE;
105 groupMap[id] = flags;
109 m_attributeFlags |= flags & AF_OBLIGATORY;
110 m_attributeFlags &= flags | ~AF_NULLABLE;
117template <
class Attribute>
122 RelatedIdsMap::const_iterator foundGroupIter = m_relatedInterfacesMap.constFind(metaGroupId);
123 if (foundGroupIter != m_relatedInterfacesMap.constEnd()){
124 const IdsToFlagsMap& groupMap = foundGroupIter.value();
126 for ( IdsToFlagsMap::const_iterator iter = groupMap.begin();
127 iter != groupMap.end();
129 const QByteArray&
id = iter.key();
130 int idFlags = iter.value();
132 if (((idFlags & flagsMask) == flags)){
144template <
class Attribute>
147 return m_description;
151template <
class Attribute>
154 return m_defaultValuePtr;
158template <
class Attribute>
161 return Attribute::GetTypeName();
165template <
class Attribute>
168 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.
@ Interfaces
ID of meta group storing list of supported interfaces.
Interface adding to attribute static info functionality existing only for real attributes.
const QByteArray & GetAttributeId() const override
Get ID of this attribute.
QByteArray GetAttributeTypeId() const override
Return attribute type ID.
void AddRelatedMetaId(IElementStaticInfo::MetaGroupId metaGroupId, const QByteArray &id, int flags) override
Add related interface to this attribute info.
int GetAttributeFlags() const override
Get flags of this attribute.
const iser::IObject * GetAttributeDefaultValue() const override
Get default attribute value.
TAttributeStaticInfo(CBaseComponentStaticInfo &staticInfo, const QByteArray &id, const QString &description, const Attribute *defaultValuePtr, int flags, const istd::CClassInfo &relatedInterfaceInfo)
IElementStaticInfo::Ids GetRelatedMetaIds(IElementStaticInfo::MetaGroupId metaGroupId, int flags, int flagsMask) const override
Get related meta information.
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.
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.