6#include <QtCore/QByteArray>
8#include <QtCore/QReadWriteLock>
9#include <QtCore/QRecursiveMutex>
10#include <QtCore/QWaitCondition>
25class IMetaInfoManager;
39 template <
class InterfaceType>
61 bool isParentOwner)
override;
73 const QByteArray& componentId,
81 bool InitializeSubcomponentInfo(
82 const QByteArray& componentId,
83 ComponentInfo& componentInfo,
99 :componentState(CS_NONE),
100 isContextInitialized(false)
113 ComponentState componentState = CS_NONE;
123 bool isContextInitialized;
126 typedef QMap<QByteArray, ComponentInfo> ComponentMap;
128 mutable ComponentMap m_componentMap;
132 bool m_isParentOwner;
134 bool m_manualAutoInit;
136 mutable bool m_autoInitialized;
139#if QT_VERSION >= 0x060000
140 mutable QRecursiveMutex m_mutex;
142 mutable QMutex m_mutex;
149template <
class InterfaceType>
154 return static_cast<InterfaceType*
>(
GetInterface(info, subId));
virtual IComponentContextSharedPtr GetSubcomponentContext(const QByteArray &componentId) const override
Get access to context of subcomponent using its ID.
virtual IComponentSharedPtr GetSubcomponent(const QByteArray &componentId) const override
Get access to subcomponent using its ID.
CCompositeComponent(bool manualAutoInit)
bool EnsureAutoInitComponentsCreated() const
Make sure, all components with flag 'AutoInit' are initialized.
bool CreateSubcomponentInfo(const QByteArray &componentId, IComponentContextSharedPtr &subContextPtr, IComponentUniquePtr *subComponentPtr, bool isOwned) const
Create information objects and subcomponent.
virtual IComponentUniquePtr CreateSubcomponent(const QByteArray &componentId) const override
Create instance of subcomponent using its ID.
InterfaceType * GetComponentInterface(const QByteArray &subId="")
Get interface implemented by this composite component.
virtual void * GetInterface(const istd::CClassInfo &interfaceType, const QByteArray &subId="") override
Get access to specified component interface.
virtual ~CCompositeComponent()
virtual void OnSubcomponentDeleted(const IComponent *subcomponentPtr) override
Called if subcomponent is removed from memory.
virtual const icomp::IComponent * GetParentComponent(bool ownerOnly=false) const override
Get parent of this component.
virtual void SetComponentContext(const IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner) override
Set component context of this component.
virtual IComponentContextSharedPtr GetComponentContext() const override
Get access to component context describing all application-specified component information loaded fro...
Main component interface.
Composite component interface.
Represents platform independent type info and provide set of static class manipulation functions.
Package with interfaces and class used for components concept.
std::unique_ptr< IComponent > IComponentUniquePtr
std::shared_ptr< icomp::IComponentContext > IComponentContextSharedPtr
std::shared_ptr< IComponent > IComponentSharedPtr