Go to the documentation of this file.
23template <
class Interface>
75template <
class Interface>
77: m_definitionComponentPtr(nullptr)
82template <
class Interface>
85 BaseClass::InitInternal(ownerPtr, staticInfo, &m_definitionComponentPtr);
89template <
class Interface>
92 return (m_definitionComponentPtr !=
nullptr) && BaseClass::IsValid();
97template <
class Interface>
100 if ((m_definitionComponentPtr !=
nullptr) && BaseClass::IsValid()){
102 if (parentPtr !=
nullptr){
103 const QByteArray& componentId = BaseClass::operator[](index);
107 BaseClass2::SplitId(componentId, baseId, subId);
108 Q_ASSERT(subId.isEmpty());
113 qCritical(
"Component %s is defined, but definition component has no parent", BaseClass::operator[](index).constData());
121template <
class Interface>
124 auto newComponentPtr = CreateComponent(index);
125 if (newComponentPtr !=
nullptr){
126 Interface* retVal = BaseClass2::ExtractInterface<Interface>(newComponentPtr.get());
127 if (retVal !=
nullptr){
128 newComponentPtr.release();
130 return std::unique_ptr<Interface>{retVal};
140template <
class Interface>
143 return BaseClass2::ExtractInterface<Interface>(componentPtr, subId);
149template <
class Interface>
152 m_definitionComponentPtr(ptr.m_definitionComponentPtr)
Main component interface.
virtual const ICompositeComponent * GetParentComponent(bool ownerOnly=false) const =0
Get parent of this component.
Composite component interface.
virtual std::unique_ptr< IComponent > CreateSubcomponent(const QByteArray &componentId) const =0
Create instance of subcomponent using its ID.
Interface adding to attribute static info functionality existing only for real attributes.
Pointer to component attribute.
Factory of components used as component member.
bool IsValid() const
Check if this factory can be resolved.
std::unique_ptr< IComponent > CreateComponent(int index) const
Create component for specified index without extracting any interface.
std::unique_ptr< Interface > CreateInstance(int index) const
Create instance of interface for specified index.
TMultiAttributeMember< CMultiFactoryAttribute > BaseClass
void Init(const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
static Interface * ExtractInterface(IComponent *componentPtr, const QByteArray &subId="")
Extract interface from some component.
CInterfaceManipBase BaseClass2
Package with interfaces and class used for components concept.
© Witold Gantzke and Kirill Lepskiy