Go to the documentation of this file.
23template <
class Interface>
59 typedef QVector<Interface*> Components;
60 mutable Components m_components;
61 mutable bool m_isInitialized;
67template <
class Interface>
69: m_definitionComponentPtr(nullptr), m_isInitialized(false)
74template <
class Interface>
77 BaseClass::InitInternal(ownerPtr, staticInfo, &m_definitionComponentPtr);
83template <
class Interface>
86 return EnsureInitialized();
90template <
class Interface>
93 if (!m_isInitialized && (m_definitionComponentPtr !=
nullptr) && BaseClass::IsValid()){
95 if (parentPtr !=
nullptr){
96 int attributesCount = BaseClass::GetCount();
98 m_components.resize(attributesCount);
100 for (
int i = 0; i < attributesCount; ++i){
101 const QByteArray& componentId = BaseClass::operator[](i);
105 BaseClass2::SplitId(componentId, baseId, subId);
109 m_components[i] = BaseClass2::ExtractInterface<Interface>(componentPtr, subId);
112 m_isInitialized =
true;
115 qCritical(
"Components are is defined, but definition component has no parent");
119 return m_isInitialized;
123template <
class Interface>
126 Q_ASSERT(index >= 0);
128 if (EnsureInitialized()){
129 Q_ASSERT(index <
int(m_components.size()));
131 return m_components[index];
140template <
class Interface>
143 m_definitionComponentPtr(ptr.m_definitionComponentPtr),
144 m_components(ptr.m_components),
145 m_isInitialized(ptr.m_isInitialized)
Main component interface.
virtual const ICompositeComponent * GetParentComponent(bool ownerOnly=false) const =0
Get parent of this component.
Composite component interface.
virtual IComponent * GetSubcomponent(const QByteArray &componentId) const =0
Get access to subcomponent using its ID.
Interface adding to attribute static info functionality existing only for real attributes.
Pointer to component attribute.
Pointer to list of referenced component objects.
bool IsValid() const
Check if this reference can be resolved.
CInterfaceManipBase BaseClass2
TMultiAttributeMember< CMultiReferenceAttribute > BaseClass
void Init(const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
Interface * operator[](int index) const
Access to interface of component at specified index.
bool EnsureInitialized() const
Ensure that initlization process is closed.
Package with interfaces and class used for components concept.
© Witold Gantzke and Kirill Lepskiy