51 return implPtr->
SetAttr(attributeId, attributePtr);
61 return implPtr->
SetRef(referenceId, componentPtr, subelementId);
71 return implPtr->
InsertMultiRef(referenceId, componentPtr, subelementId);
81 return implPtr->
SetFactory(factoryId, factoryPtr);
111 return implPtr->
SetIntAttr(attributeId, value);
137 bool SetIdAttr(
const QByteArray& attributeId,
const QByteArray& value)
141 return implPtr->
SetIdAttr(attributeId, value);
149 template <
class Attribute>
190 static QByteArray
id = istd::CClassInfo::GetName<Base>();
197 ComponentsMap::ConstIterator iter =
m_componentsMap.constFind(componentId);
207 FactoriesMap::ConstIterator iter =
m_factoriesMap.constFind(componentId);
209 Q_ASSERT(iter.value() !=
nullptr);
236 SetComponentContext(m_contextPtr,
NULL,
false);
270 qFatal(
"Simulated component cannot have sub-components");
303 return *
dynamic_cast<Impl*
>(get());
308 return *
dynamic_cast<Impl*
>(get());
313 return dynamic_cast<Impl*
>(get());
318 return *
dynamic_cast<Impl*
>(get());
bool SetIdAttr(const QByteArray &attributeId, const QByteArray &value)
Set instance of QByteArray attribute.
bool InsertMultiAttr(const QByteArray &attributeId, const Attribute &attribute)
Insert new attribute to multi attributes.
bool SetFactory(const QByteArray &factoryId, const ComponentsFactory *factoryPtr)
Set factory of component instance.
bool SetBoolAttr(const QByteArray &attributeId, bool value)
Set instance of bool attribute.
bool SetAttr(const QByteArray &attributeId, const iser::IObject *attributePtr)
Set named attribute.
bool SetStringAttr(const QByteArray &attributeId, const QString &value)
Set instance of QString attribute.
ComponentsMap m_componentsMap
bool InsertMultiFactory(const QByteArray &factoryId, const ComponentsFactory *factoryPtr)
Insert new factory instance into multi-factory attribute.
FactoriesMap m_factoriesMap
bool SetDoubleAttr(const QByteArray &attributeId, double value)
Set instance of double attribute.
bool SetIntAttr(const QByteArray &attributeId, int value)
Set instance of int attribute.
bool SetRef(const QByteArray &referenceId, IComponentSharedPtr componentPtr, const QByteArray &subelementId="")
Set named reference to some component.
bool InsertMultiRef(const QByteArray &referenceId, IComponentSharedPtr componentPtr, const QByteArray &subelementId="")
Set named reference to some component.
Main component interface.
This interface provide static information about component meta info.
Composite component interface.
Wrapper of end component implementation used to correct control of component life-cycle.
IComponentUniquePtr CreateSubcomponent(const QByteArray &componentId) const
virtual const QByteArray & GetContextId() const override
Get ID of this component in the context tree.
IComponentSharedPtr GetSubcomponent(const QByteArray &componentId) const
SimulationContext(const IComponentStaticInfo *infoPtr)
Simulation wrapper of component.
IComponentSharedPtr m_componentPtr
bool SetFactory(const QByteArray &factoryId, const CSimComponentContextBase::ComponentsFactory *factoryPtr)
Set factory of component instance.
virtual IComponentContextSharedPtr GetSubcomponentContext(const QByteArray &componentId) const override
Get access to context of subcomponent using its ID.
IComponentContextSharedPtr m_contextPtr
TComponentWrap< Base > BaseClass
bool SetBoolAttr(const QByteArray &attributeId, bool value)
Set instance of bool attribute.
virtual IComponentUniquePtr CreateSubcomponent(const QByteArray &componentId) const override
Create instance of subcomponent using its ID.
bool SetAttr(const QByteArray &attributeId, const iser::IObject *attributePtr)
Set named attribute.
bool SetRef(const QByteArray &referenceId, IComponentSharedPtr componentPtr, const QByteArray &subelementId="")
Set named reference to some component.
bool InsertMultiAttr(const QByteArray &attributeId, const QString &attribute)
void InitComponent()
Initialilze component after setting all its attributes and references.
virtual const IComponent * GetParentComponent(bool ownerOnly=false) const override
Get parent of this component.
bool InsertMultiAttr(const QByteArray &attributeId, const Attribute &attribute)
Insert new attribute to multi attributes.
bool SetIdAttr(const QByteArray &attributeId, const QByteArray &value)
Set instance of QByteArray attribute.
bool SetIntAttr(const QByteArray &attributeId, int value)
Set instance of int attribute.
virtual void OnSubcomponentDeleted(const IComponent *subcomponentPtr) override
Called if subcomponent is removed from memory.
bool SetDoubleAttr(const QByteArray &attributeId, double value)
Set instance of double attribute.
bool SetStringAttr(const QByteArray &attributeId, const QString &value)
Set instance of QString attribute.
virtual IComponentSharedPtr GetSubcomponent(const QByteArray &componentId) const override
Get access to subcomponent using its ID.
bool InsertMultiRef(const QByteArray &referenceId, IComponentSharedPtr componentPtr, const QByteArray &subelementId="")
Set named reference to some component.
bool InsertMultiFactory(const QByteArray &factoryId, const CSimComponentContextBase::ComponentsFactory *factoryPtr)
Insert new factory instance into multi-factory attribute.
icomp::TSimComponentWrap< Base > Impl
const Impl & GetImpl() const
Common interface for factorisable model objects.
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