ICF 3.0.5.47
Technical documentation of ICF Libraries
icomp::CSimComponentContextBase Class Reference

#include <CSimComponentContextBase.h>

Inheritance diagram for icomp::CSimComponentContextBase:
Collaboration diagram for icomp::CSimComponentContextBase:

Public Types

typedef istd::TIFactory< IComponentComponentsFactory
 

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 IRegistryElementGetRegistryElement () const
 Get access to component registry element object.
 
virtual const IComponentStaticInfoGetStaticInfo () const
 Get component static info associated with this context.
 
virtual const IComponentContextGetParentContext () const
 Get access to parent component context.
 
virtual const iser::IObjectGetAttribute (const QByteArray &attributeId, int *definitionLevelPtr=nullptr) const
 Get attribute using its ID.
 
- Public Member Functions inherited from icomp::IComponentContext
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 Protected Member Functions inherited from istd::CIdManipBase
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.
 

Detailed Description

Definition at line 32 of file CSimComponentContextBase.h.

Member Typedef Documentation

◆ ComponentsFactory

◆ ComponentsMap

Definition at line 145 of file CSimComponentContextBase.h.

◆ FactoriesMap

Definition at line 148 of file CSimComponentContextBase.h.

Constructor & Destructor Documentation

◆ CSimComponentContextBase()

icomp::CSimComponentContextBase::CSimComponentContextBase ( const IComponentStaticInfo * infoPtr)
explicit

Member Function Documentation

◆ GetAttribute()

virtual const iser::IObject * icomp::CSimComponentContextBase::GetAttribute ( const QByteArray & attributeId,
int * definitionLevelPtr = nullptr ) const
virtual

Get attribute using its ID.

Parameters
attributeIdID of attribute.
definitionLevelPtroptional 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.

◆ GetParentContext()

virtual const IComponentContext * icomp::CSimComponentContextBase::GetParentContext ( ) const
virtual

Get access to parent component context.

Implements icomp::IComponentContext.

◆ GetRegistryElement()

virtual const IRegistryElement & icomp::CSimComponentContextBase::GetRegistryElement ( ) const
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.

◆ GetStaticInfo()

virtual const IComponentStaticInfo & icomp::CSimComponentContextBase::GetStaticInfo ( ) const
virtual

Get component static info associated with this context.

Implements icomp::IComponentContext.

◆ InsertMultiAttr() [1/2]

template<class Attribute >
bool icomp::CSimComponentContextBase::InsertMultiAttr ( const QByteArray & attributeId,
const Attribute & attribute )
inline

Insert new attribute to multi attributes.

Parameters
attributeIdID of attribute (multi attribute).
attributesingle 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().

◆ InsertMultiAttr() [2/2]

bool icomp::CSimComponentContextBase::InsertMultiAttr ( const QByteArray & attributeId,
const QString & attribute )

◆ InsertMultiFactory()

bool icomp::CSimComponentContextBase::InsertMultiFactory ( const QByteArray & factoryId,
const ComponentsFactory * factoryPtr )

Insert new factory instance into multi-factory attribute.

◆ InsertMultiRef()

bool icomp::CSimComponentContextBase::InsertMultiRef ( const QByteArray & referenceId,
IComponent * componentPtr,
const QByteArray & subelementId = "" )

Set named reference to some component.

◆ IsAttributeTypeCorrect()

template<class AttrType >
bool icomp::CSimComponentContextBase::IsAttributeTypeCorrect ( const QByteArray & attributeId)
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().

◆ SetAttr()

bool icomp::CSimComponentContextBase::SetAttr ( const QByteArray & attributeId,
const iser::IObject * attributePtr )

Set named attribute.

Parameters
attributeIdID of attribute.
attributePtrpointer to attribute instance. It will be automatically deleted.

◆ SetBoolAttr()

bool icomp::CSimComponentContextBase::SetBoolAttr ( const QByteArray & attributeId,
bool value )

Set instance of bool attribute.

◆ SetDoubleAttr()

bool icomp::CSimComponentContextBase::SetDoubleAttr ( const QByteArray & attributeId,
double value )

Set instance of double attribute.

◆ SetFactory()

bool icomp::CSimComponentContextBase::SetFactory ( const QByteArray & factoryId,
const ComponentsFactory * factoryPtr )

Set factory of component instance.

◆ SetIdAttr()

bool icomp::CSimComponentContextBase::SetIdAttr ( const QByteArray & attributeId,
const QByteArray & value )

Set instance of QByteArray attribute.

◆ SetIntAttr()

bool icomp::CSimComponentContextBase::SetIntAttr ( const QByteArray & attributeId,
int value )

Set instance of int attribute.

◆ SetRef()

bool icomp::CSimComponentContextBase::SetRef ( const QByteArray & referenceId,
IComponent * componentPtr,
const QByteArray & subelementId = "" )

Set named reference to some component.

◆ SetStringAttr()

bool icomp::CSimComponentContextBase::SetStringAttr ( const QByteArray & attributeId,
const QString & value )

Set instance of QString attribute.

Member Data Documentation

◆ m_componentsMap

ComponentsMap icomp::CSimComponentContextBase::m_componentsMap
protected

Definition at line 146 of file CSimComponentContextBase.h.

◆ m_factoriesMap

FactoriesMap icomp::CSimComponentContextBase::m_factoriesMap
protected

Definition at line 149 of file CSimComponentContextBase.h.


The documentation for this class was generated from the following file:

© Witold Gantzke and Kirill Lepskiy