ACF $AcfVersion:0$
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
icomp::CSimComponentContextBase Class Reference

#include <CSimComponentContextBase.h>

Inheritance diagram for icomp::CSimComponentContextBase:
icomp::IComponentContext istd::CIdManipBase istd::IPolymorphic icomp::TSimComponentWrap< Base >::SimulationContext

Public Types

typedef istd::TIFactory< icomp::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, 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.
 
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 override
 Get access to component registry element object.
 
virtual const IComponentStaticInfoGetStaticInfo () const override
 Get component static info associated with this context.
 
virtual const IComponentContextGetParentContext () const override
 Get access to parent component context.
 
virtual const iser::IObjectGetAttribute (const QByteArray &attributeId, int *definitionLevelPtr=NULL) const override
 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.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Types

typedef QMap< QByteArray, IComponentSharedPtrComponentsMap
 
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 28 of file CSimComponentContextBase.h.

Member Typedef Documentation

◆ ComponentsFactory

Definition at line 33 of file CSimComponentContextBase.h.

◆ ComponentsMap

Definition at line 141 of file CSimComponentContextBase.h.

◆ FactoriesMap

typedef QMap< QByteArray, const ComponentsFactory* > icomp::CSimComponentContextBase::FactoriesMap
protected

Definition at line 144 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 = NULL 
) const
overridevirtual

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
overridevirtual

Get access to parent component context.

Implements icomp::IComponentContext.

◆ GetRegistryElement()

virtual const IRegistryElement & icomp::CSimComponentContextBase::GetRegistryElement ( ) const
overridevirtual

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
overridevirtual

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

◆ 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.

Referenced by icomp::TSimComponentWrap< Base >::InsertMultiFactory().

◆ InsertMultiRef()

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

Set named reference to some component.

Referenced by icomp::TSimComponentWrap< Base >::InsertMultiRef().

◆ IsAttributeTypeCorrect()

template<class AttrType >
bool icomp::CSimComponentContextBase::IsAttributeTypeCorrect ( const QByteArray &  attributeId)
protected

Check if attribute type is corrected.

Definition at line 156 of file CSimComponentContextBase.h.

References icomp::IComponentStaticInfo::GetAttributeInfo(), iattr::IAttributeMetaInfo::GetAttributeTypeId(), and NULL.

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.

Referenced by icomp::TSimComponentWrap< Base >::SetAttr().

◆ SetBoolAttr()

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

Set instance of bool attribute.

Referenced by icomp::TSimComponentWrap< Base >::SetBoolAttr().

◆ SetDoubleAttr()

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

Set instance of double attribute.

Referenced by icomp::TSimComponentWrap< Base >::SetDoubleAttr().

◆ SetFactory()

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

Set factory of component instance.

Referenced by icomp::TSimComponentWrap< Base >::SetFactory().

◆ SetIdAttr()

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

Set instance of QByteArray attribute.

Referenced by icomp::TSimComponentWrap< Base >::SetIdAttr().

◆ SetIntAttr()

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

Set instance of int attribute.

Referenced by icomp::TSimComponentWrap< Base >::SetIntAttr().

◆ SetRef()

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

Set named reference to some component.

Referenced by icomp::TSimComponentWrap< Base >::SetRef().

◆ SetStringAttr()

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

Set instance of QString attribute.

Referenced by icomp::TSimComponentWrap< Base >::SetStringAttr().

Member Data Documentation

◆ m_componentsMap

ComponentsMap icomp::CSimComponentContextBase::m_componentsMap
protected

◆ m_factoriesMap

FactoriesMap icomp::CSimComponentContextBase::m_factoriesMap
protected

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