ACF $AcfVersion:0$
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
icomp::TSimComponentWrap< Base > Class Template Reference

Simulation wrapper of component. More...

#include <TSimComponentWrap.h>

Inheritance diagram for icomp::TSimComponentWrap< Base >:
icomp::TComponentWrap< Base > icomp::ICompositeComponent icomp::IComponent istd::IPolymorphic

Classes

class  SimulationContext
 

Public Types

typedef TComponentWrap< Base > BaseClass
 
- Public Types inherited from icomp::TComponentWrap< Base >
typedef Base BaseClass
 

Public Member Functions

 TSimComponentWrap ()
 
 ~TSimComponentWrap ()
 
void InitComponent ()
 Initialilze component after setting all its attributes and references.
 
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 CSimComponentContextBase::ComponentsFactory *factoryPtr)
 Set factory of component instance.
 
bool InsertMultiFactory (const QByteArray &factoryId, const CSimComponentContextBase::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 IComponentSharedPtr GetSubcomponent (const QByteArray &componentId) const override
 Get access to subcomponent using its ID.
 
virtual IComponentContextSharedPtr GetSubcomponentContext (const QByteArray &componentId) const override
 Get access to context of subcomponent using its ID.
 
virtual IComponentUniquePtr CreateSubcomponent (const QByteArray &componentId) const override
 Create instance of subcomponent using its ID.
 
virtual void OnSubcomponentDeleted (const IComponent *subcomponentPtr) override
 Called if subcomponent is removed from memory.
 
virtual const IComponentGetParentComponent (bool ownerOnly=false) const override
 Get parent of this component.
 
- Public Member Functions inherited from icomp::TComponentWrap< Base >
 TComponentWrap ()
 
virtual ~TComponentWrap ()
 
virtual void SetComponentContext (const IComponentContextSharedPtr &contextPtr, const IComponent *parentPtr, bool isParentOwner) override
 
- Public Member Functions inherited from icomp::IComponent
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="")=0
 Get access to specified component interface.
 
virtual IComponentContextSharedPtr GetComponentContext () const =0
 Get access to component context describing all application-specified component information loaded from components registry.
 
virtual void SetComponentContext (const IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner)=0
 Set component context of this component.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Attributes

IComponentContextSharedPtr m_contextPtr
 
IComponentSharedPtr m_componentPtr
 

Detailed Description

template<class Base>
class icomp::TSimComponentWrap< Base >

Simulation wrapper of component.

It allows to use components directly from static linked libraries, without component framework.

Definition at line 23 of file TSimComponentWrap.h.

Member Typedef Documentation

◆ BaseClass

template<class Base >
typedef TComponentWrap<Base> icomp::TSimComponentWrap< Base >::BaseClass

Definition at line 28 of file TSimComponentWrap.h.

Constructor & Destructor Documentation

◆ TSimComponentWrap()

template<class Base >
icomp::TSimComponentWrap< Base >::TSimComponentWrap ( )

◆ ~TSimComponentWrap()

template<class Base >
icomp::TSimComponentWrap< Base >::~TSimComponentWrap ( )
inline

Member Function Documentation

◆ CreateSubcomponent()

template<class Base >
IComponentUniquePtr icomp::TSimComponentWrap< Base >::CreateSubcomponent ( const QByteArray &  componentId) const
overridevirtual

Create instance of subcomponent using its ID.

Implements icomp::ICompositeComponent.

Definition at line 259 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::SimulationContext::CreateSubcomponent().

◆ GetParentComponent()

template<class Base >
const IComponent * icomp::TSimComponentWrap< Base >::GetParentComponent ( bool  ownerOnly = false) const
overridevirtual

Get parent of this component.

Parent is component who created this component. Parent component can be also owner of this component. It means manages life time of this componenent.

Parameters
ownerOnlyindicate, that parent should be returned only if it owns this component.
Returns
pointer to parent component or NULL if parent is not accessible.

Implements icomp::IComponent.

Definition at line 277 of file TSimComponentWrap.h.

References NULL.

◆ GetSubcomponent()

template<class Base >
IComponentSharedPtr icomp::TSimComponentWrap< Base >::GetSubcomponent ( const QByteArray &  componentId) const
overridevirtual

Get access to subcomponent using its ID.

Implements icomp::ICompositeComponent.

Definition at line 243 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::SimulationContext::GetSubcomponent().

◆ GetSubcomponentContext()

template<class Base >
icomp::IComponentContextSharedPtr icomp::TSimComponentWrap< Base >::GetSubcomponentContext ( const QByteArray &  componentId) const
overridevirtual

Get access to context of subcomponent using its ID.

Please note, that this does'n create component instance.

Implements icomp::ICompositeComponent.

Definition at line 252 of file TSimComponentWrap.h.

◆ InitComponent()

template<class Base >
void icomp::TSimComponentWrap< Base >::InitComponent ( )

Initialilze component after setting all its attributes and references.

Definition at line 234 of file TSimComponentWrap.h.

References NULL.

Referenced by icomp::TSimComponentsFactory< Base >::TSimComponentsFactory().

◆ InsertMultiAttr() [1/2]

template<class Base >
template<class Attribute >
bool icomp::TSimComponentWrap< Base >::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 150 of file TSimComponentWrap.h.

References icomp::CSimComponentContextBase::InsertMultiAttr(), and icomp::TSimComponentWrap< Base >::m_contextPtr.

◆ InsertMultiAttr() [2/2]

template<class Base >
bool icomp::TSimComponentWrap< Base >::InsertMultiAttr ( const QByteArray &  attributeId,
const QString &  attribute 
)
inline

◆ InsertMultiFactory()

template<class Base >
bool icomp::TSimComponentWrap< Base >::InsertMultiFactory ( const QByteArray &  factoryId,
const CSimComponentContextBase::ComponentsFactory factoryPtr 
)
inline

Insert new factory instance into multi-factory attribute.

Definition at line 87 of file TSimComponentWrap.h.

References icomp::CSimComponentContextBase::InsertMultiFactory(), and icomp::TSimComponentWrap< Base >::m_contextPtr.

◆ InsertMultiRef()

template<class Base >
bool icomp::TSimComponentWrap< Base >::InsertMultiRef ( const QByteArray &  referenceId,
IComponentSharedPtr  componentPtr,
const QByteArray &  subelementId = "" 
)
inline

Set named reference to some component.

Definition at line 67 of file TSimComponentWrap.h.

References icomp::CSimComponentContextBase::InsertMultiRef(), and icomp::TSimComponentWrap< Base >::m_contextPtr.

◆ OnSubcomponentDeleted()

template<class Base >
void icomp::TSimComponentWrap< Base >::OnSubcomponentDeleted ( const IComponent subcomponentPtr)
overridevirtual

Called if subcomponent is removed from memory.

Parameters
subcomponentPtrpointer to component beeing removed. It cannot be NULL.

Implements icomp::ICompositeComponent.

Definition at line 268 of file TSimComponentWrap.h.

◆ SetAttr()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetAttr ( const QByteArray &  attributeId,
const iser::IObject attributePtr 
)
inline

Set named attribute.

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

Definition at line 47 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetAttr().

◆ SetBoolAttr()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetBoolAttr ( const QByteArray &  attributeId,
bool  value 
)
inline

Set instance of bool attribute.

Definition at line 97 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetBoolAttr().

◆ SetDoubleAttr()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetDoubleAttr ( const QByteArray &  attributeId,
double  value 
)
inline

Set instance of double attribute.

Definition at line 117 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetDoubleAttr().

◆ SetFactory()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetFactory ( const QByteArray &  factoryId,
const CSimComponentContextBase::ComponentsFactory factoryPtr 
)
inline

Set factory of component instance.

Definition at line 77 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetFactory().

◆ SetIdAttr()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetIdAttr ( const QByteArray &  attributeId,
const QByteArray &  value 
)
inline

Set instance of QByteArray attribute.

Definition at line 137 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetIdAttr().

◆ SetIntAttr()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetIntAttr ( const QByteArray &  attributeId,
int  value 
)
inline

Set instance of int attribute.

Definition at line 107 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetIntAttr().

◆ SetRef()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetRef ( const QByteArray &  referenceId,
IComponentSharedPtr  componentPtr,
const QByteArray &  subelementId = "" 
)
inline

Set named reference to some component.

Definition at line 57 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetRef().

◆ SetStringAttr()

template<class Base >
bool icomp::TSimComponentWrap< Base >::SetStringAttr ( const QByteArray &  attributeId,
const QString &  value 
)
inline

Set instance of QString attribute.

Definition at line 127 of file TSimComponentWrap.h.

References icomp::TSimComponentWrap< Base >::m_contextPtr, and icomp::CSimComponentContextBase::SetStringAttr().

Member Data Documentation

◆ m_componentPtr

template<class Base >
IComponentSharedPtr icomp::TSimComponentWrap< Base >::m_componentPtr
protected

Definition at line 219 of file TSimComponentWrap.h.

◆ m_contextPtr

template<class Base >
IComponentContextSharedPtr icomp::TSimComponentWrap< Base >::m_contextPtr
protected

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