![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
#include <CSimComponentContextBase.h>
Public Types | |
typedef istd::TIFactory< IComponent > | ComponentsFactory |
Public Member Functions | |
CSimComponentContextBase (const IComponentStaticInfo *infoPtr) | |
bool | SetAttr (const QByteArray &attributeId, const iser::IObject *attributePtr) |
Set named attribute. | |
bool | SetRef (const QByteArray &referenceId, IComponent *componentPtr, const QByteArray &subelementId="") |
Set named reference to some component. | |
bool | InsertMultiRef (const QByteArray &referenceId, IComponent *componentPtr, const QByteArray &subelementId="") |
Set named reference to some component. | |
bool | SetFactory (const QByteArray &factoryId, const ComponentsFactory *factoryPtr) |
Set factory of component instance. | |
bool | InsertMultiFactory (const QByteArray &factoryId, const ComponentsFactory *factoryPtr) |
Insert new factory instance into multi-factory attribute. | |
bool | SetBoolAttr (const QByteArray &attributeId, bool value) |
Set instance of bool attribute. | |
bool | SetIntAttr (const QByteArray &attributeId, int value) |
Set instance of int attribute. | |
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. | |
bool | SetIdAttr (const QByteArray &attributeId, const QByteArray &value) |
Set instance of QByteArray attribute. | |
template<class Attribute > | |
bool | InsertMultiAttr (const QByteArray &attributeId, const Attribute &attribute) |
Insert new attribute to multi attributes. | |
bool | InsertMultiAttr (const QByteArray &attributeId, const QString &attribute) |
virtual const IRegistryElement & | GetRegistryElement () const |
Get access to component registry element object. | |
virtual const IComponentStaticInfo & | GetStaticInfo () const |
Get component static info associated with this context. | |
virtual const IComponentContext * | GetParentContext () const |
Get access to parent component context. | |
virtual const iser::IObject * | GetAttribute (const QByteArray &attributeId, int *definitionLevelPtr=nullptr) const |
Get attribute using its ID. | |
![]() | |
virtual const QByteArray & | GetContextId () const =0 |
Get ID of this component in the context tree. | |
Protected Types | |
typedef QMap< QByteArray, IComponent * > | ComponentsMap |
typedef QMap< QByteArray, const ComponentsFactory * > | FactoriesMap |
Protected Member Functions | |
template<class AttrType > | |
bool | IsAttributeTypeCorrect (const QByteArray &attributeId) |
Check if attribute type is corrected. | |
Protected Attributes | |
ComponentsMap | m_componentsMap |
FactoriesMap | m_factoriesMap |
Additional Inherited Members | |
![]() | |
static bool | SplitId (const QByteArray &complexId, QByteArray &baseId, QByteArray &subId) |
Split component ID into separated ID's. | |
static QByteArray | JoinId (const QByteArray &baseId, const QByteArray &subId) |
Join base component ID and sub ID into composed component ID. | |
Definition at line 32 of file CSimComponentContextBase.h.
Definition at line 37 of file CSimComponentContextBase.h.
|
protected |
Definition at line 145 of file CSimComponentContextBase.h.
|
protected |
Definition at line 148 of file CSimComponentContextBase.h.
|
explicit |
|
virtual |
Get attribute using its ID.
attributeId | ID of attribute. |
definitionLevelPtr | optional return value. This will be set to number parents you have to iterate to get component where this attribute was defined. If this attribute was defined in actual component it equals 0. |
Implements icomp::IComponentContext.
|
virtual |
Get access to parent component context.
Implements icomp::IComponentContext.
|
virtual |
Get access to component registry element object.
State of the component context is based on this registry element (part of registry document describing component) and context parent.
Implements icomp::IComponentContext.
|
virtual |
Get component static info associated with this context.
Implements icomp::IComponentContext.
|
inline |
Insert new attribute to multi attributes.
attributeId | ID of attribute (multi attribute). |
attribute | single attribute value. |
Definition at line 99 of file CSimComponentContextBase.h.
References icomp::IRegistryElement::AttributeInfo::attributePtr, icomp::CRegistryElement::GetAttributeInfo(), istd::CClassInfo::GetName(), icomp::CRegistryElement::InsertAttributeInfo(), iattr::TMultiAttribute< Value >::InsertValue(), and IsAttributeTypeCorrect().
bool icomp::CSimComponentContextBase::InsertMultiAttr | ( | const QByteArray & | attributeId, |
const QString & | attribute ) |
bool icomp::CSimComponentContextBase::InsertMultiFactory | ( | const QByteArray & | factoryId, |
const ComponentsFactory * | factoryPtr ) |
Insert new factory instance into multi-factory attribute.
bool icomp::CSimComponentContextBase::InsertMultiRef | ( | const QByteArray & | referenceId, |
IComponent * | componentPtr, | ||
const QByteArray & | subelementId = "" ) |
Set named reference to some component.
|
protected |
Check if attribute type is corrected.
Definition at line 160 of file CSimComponentContextBase.h.
References icomp::IComponentStaticInfo::GetAttributeInfo(), and iattr::IAttributeMetaInfo::GetAttributeTypeId().
Referenced by InsertMultiAttr().
bool icomp::CSimComponentContextBase::SetAttr | ( | const QByteArray & | attributeId, |
const iser::IObject * | attributePtr ) |
Set named attribute.
attributeId | ID of attribute. |
attributePtr | pointer to attribute instance. It will be automatically deleted. |
bool icomp::CSimComponentContextBase::SetBoolAttr | ( | const QByteArray & | attributeId, |
bool | value ) |
Set instance of bool
attribute.
bool icomp::CSimComponentContextBase::SetDoubleAttr | ( | const QByteArray & | attributeId, |
double | value ) |
Set instance of double
attribute.
bool icomp::CSimComponentContextBase::SetFactory | ( | const QByteArray & | factoryId, |
const ComponentsFactory * | factoryPtr ) |
Set factory of component instance.
bool icomp::CSimComponentContextBase::SetIdAttr | ( | const QByteArray & | attributeId, |
const QByteArray & | value ) |
Set instance of QByteArray
attribute.
bool icomp::CSimComponentContextBase::SetIntAttr | ( | const QByteArray & | attributeId, |
int | value ) |
Set instance of int
attribute.
bool icomp::CSimComponentContextBase::SetRef | ( | const QByteArray & | referenceId, |
IComponent * | componentPtr, | ||
const QByteArray & | subelementId = "" ) |
Set named reference to some component.
bool icomp::CSimComponentContextBase::SetStringAttr | ( | const QByteArray & | attributeId, |
const QString & | value ) |
Set instance of QString
attribute.
|
protected |
Definition at line 146 of file CSimComponentContextBase.h.
|
protected |
Definition at line 149 of file CSimComponentContextBase.h.
© Witold Gantzke and Kirill Lepskiy