22template <
class Interface>
78template <
class Interface>
80: m_definitionComponentPtr(
NULL)
85template <
class Interface>
88 BaseClass::InitInternal(ownerPtr, staticInfo, &m_definitionComponentPtr);
92template <
class Interface>
95 return (m_definitionComponentPtr !=
NULL) && BaseClass::IsValid();
100template <
class Interface>
103 if ((m_definitionComponentPtr !=
NULL) && BaseClass::IsValid()){
105 if (parentPtr !=
NULL){
106 const QByteArray& componentId = BaseClass::operator*();
110 BaseClass2::SplitId(componentId, baseId, subId);
111 Q_ASSERT(subId.isEmpty());
116 qCritical(
"Component %s is defined, but definition component has no parent", BaseClass::operator*().constData());
124template <
class Interface>
128 if (newComponentPtr !=
nullptr){
129 Interface* retVal = BaseClass2::ExtractInterface<Interface>(newComponentPtr.get());
130 if (retVal !=
NULL) {
141template <
class Interface>
145 if (defaultList.isEmpty()){
146 defaultList <<
"Component";
155template <
class Interface>
158 if (instancePtr !=
NULL){
160 Q_ASSERT(componentPtr !=
NULL);
162 if (componentPtr !=
NULL){
163 return BaseClass2::ExtractInterface<Interface>(componentPtr, subId);
173template <
class Interface>
176 m_definitionComponentPtr(ptr.m_definitionComponentPtr)
Main component interface.
Composite component interface.
virtual IComponentUniquePtr 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.
TAttributeMember< CFactoryAttribute > BaseClass
istd::IFactoryInfo::KeyList KeyList
IComponentUniquePtr CreateComponent() const
Create component without extracting any interface.
static Interface * ExtractInterface(istd::IPolymorphic *instancePtr, const QByteArray &subId="")
Extract interface from some component.
bool IsValid() const
Check if this factory can be resolved.
void Init(const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
CInterfaceManipBase BaseClass2
virtual istd::TUniqueInterfacePtr< Interface > CreateInstance(const QByteArray &typeId=QByteArray()) const override
virtual KeyList GetFactoryKeys() const override
Returns all possible keys for this factory.
QSet< QByteArray > KeyList
Base interface for all used interfaces and implementations.
Unique ownership smart pointer for interface types.
Package with interfaces and class used for components concept.
std::unique_ptr< IComponent > IComponentUniquePtr