19template <
typename Attribute>
67 const Attribute* m_attributePtr;
73template <
typename Attribute>
80template <
typename Attribute>
85 InitInternal(ownerPtr, staticInfo,
NULL);
89template <
typename Attribute>
92 return (m_attributePtr !=
NULL);
96template <
typename Attribute>
99 if (m_attributePtr !=
NULL){
100 return m_attributePtr->GetValuesCount();
108template <
typename Attribute>
111 Q_ASSERT(index >= 0);
112 Q_ASSERT(index < GetCount());
113 Q_ASSERT(m_attributePtr !=
NULL);
114 Q_ASSERT(m_attributePtr->GetValuesCount() == GetCount());
116 return m_attributePtr->GetValueAt(index);
120template <
typename Attribute>
123 if (m_attributePtr !=
NULL){
124 return m_attributePtr->FindValue(value);
133template <
typename Attribute>
139 Q_ASSERT(ownerPtr !=
NULL);
143 if (componentContextPtr.get()){
144 int definitionLevel = -1;
145 const iser::IObject* attributePtr = componentContextPtr->GetAttribute(attributeId, &definitionLevel);
146 m_attributePtr =
dynamic_cast<const Attribute*
>(attributePtr);
148 if (m_attributePtr !=
NULL){
149 Q_ASSERT(definitionLevel >= 0);
151 if (definitionComponentPtr !=
NULL){
152 while (definitionLevel > 0 && (ownerPtr !=
nullptr)){
159 *definitionComponentPtr = ownerPtr;
166 m_attributePtr =
NULL;
215 return QCoreApplication::translate(
"Attribute", BaseClass::operator[](index).toLatin1());
Template implementation of multiple component attribute.
CMultiTextAttribute(int elementsCount, QString *valuesPtr)
virtual QByteArray GetFactoryId() const override
static QByteArray GetTypeName()
iattr::CStringListAttribute BaseClass
TMultiAttributeMember< CMultiTextAttribute > BaseClass
QString operator[](int index) const
@ AF_TRANSLATABLE
Attribute is able to translate.
Main component interface.
virtual const icomp::IComponent * GetParentComponent(bool ownerOnly=false) const =0
Get parent of this component.
virtual IComponentContextSharedPtr GetComponentContext() const =0
Get access to component context describing all application-specified component information loaded fro...
Interface adding to attribute static info functionality existing only for real attributes.
virtual const QByteArray & GetAttributeId() const =0
Get ID of this attribute.
Pointer to component attribute.
bool IsValid() const
Check if this attribute is valid.
int FindValue(const AttributeValueType &value) const
Find attribute value.
const AttributeValueType & operator[](int index) const
Access to object pointed by internal pointer.
Attribute::ValueType AttributeValueType
void Init(const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
Internal initialize of attribute.
int GetCount() const
Get number of attributes.
bool InitInternal(const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo, const IComponent **definitionComponentPtr)
Common interface for factorisable model objects.
Package with interfaces and class used for components concept.
std::shared_ptr< icomp::IComponentContext > IComponentContextSharedPtr