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 > icomp::TSimComponentsFactory< Base >

Public Types

typedef istd::TIFactory
< icomp::IComponent
ComponentsFactory
 

Public Member Functions

 CSimComponentContextBase (const IComponentStaticInfo *infoPtr)
 
bool SetAttr (const QByteArray &attributeId, const iser::IObject *attributePtr)
 Set named attribute. More...
 
bool SetRef (const QByteArray &referenceId, IComponent *componentPtr, const QByteArray &subelementId="")
 Set named reference to some component. More...
 
bool InsertMultiRef (const QByteArray &referenceId, IComponent *componentPtr, const QByteArray &subelementId="")
 Set named reference to some component. More...
 
bool SetFactory (const QByteArray &factoryId, const ComponentsFactory *factoryPtr)
 Set factory of component instance. More...
 
bool InsertMultiFactory (const QByteArray &factoryId, const ComponentsFactory *factoryPtr)
 Insert new factory instance into multi-factory attribute. More...
 
bool SetBoolAttr (const QByteArray &attributeId, bool value)
 Set instance of bool attribute. More...
 
bool SetIntAttr (const QByteArray &attributeId, int value)
 Set instance of int attribute. More...
 
bool SetDoubleAttr (const QByteArray &attributeId, double value)
 Set instance of double attribute. More...
 
bool SetStringAttr (const QByteArray &attributeId, const QString &value)
 Set instance of QString attribute. More...
 
bool SetIdAttr (const QByteArray &attributeId, const QByteArray &value)
 Set instance of QByteArray attribute. More...
 
template<class Attribute >
bool InsertMultiAttr (const QByteArray &attributeId, const Attribute &attribute)
 Insert new attribute to multi attributes. More...
 
bool InsertMultiAttr (const QByteArray &attributeId, const QString &attribute)
 
virtual const IRegistryElementGetRegistryElement () const
 Get access to component registry element object. More...
 
virtual const
IComponentStaticInfo
GetStaticInfo () const
 Get component static info associated with this context. More...
 
virtual const IComponentContextGetParentContext () const
 Get access to parent component context. More...
 
virtual const iser::IObjectGetAttribute (const QByteArray &attributeId, int *definitionLevelPtr=NULL) const
 Get attribute using its ID. More...
 
- Public Member Functions inherited from icomp::IComponentContext
virtual const QByteArray & GetContextId () const =0
 Get ID of this component in the context tree. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

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

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. More...
 
static QByteArray JoinId (const QByteArray &baseId, const QByteArray &subId)
 Join base component ID and sub ID into composed component ID. More...
 

Detailed Description

Definition at line 28 of file CSimComponentContextBase.h.

Member Typedef Documentation

Definition at line 33 of file CSimComponentContextBase.h.

typedef QMap<QByteArray, IComponent*> icomp::CSimComponentContextBase::ComponentsMap
protected

Definition at line 141 of file CSimComponentContextBase.h.

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

Definition at line 144 of file CSimComponentContextBase.h.

Constructor & Destructor Documentation

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

Member Function Documentation

virtual const iser::IObject* icomp::CSimComponentContextBase::GetAttribute ( const QByteArray &  attributeId,
int *  definitionLevelPtr = NULL 
) 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.

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

Get access to parent component context.

Implements icomp::IComponentContext.

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.

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

Get component static info associated with this context.

Implements icomp::IComponentContext.

template<class Attribute >
bool icomp::CSimComponentContextBase::InsertMultiAttr ( const QByteArray &  attributeId,
const Attribute &  attribute 
)
inline
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.

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().

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

Member Data Documentation

ComponentsMap icomp::CSimComponentContextBase::m_componentsMap
protected

Definition at line 142 of file CSimComponentContextBase.h.

FactoriesMap icomp::CSimComponentContextBase::m_factoriesMap
protected

Definition at line 145 of file CSimComponentContextBase.h.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy