Public Member Functions | Protected Types | Protected Member Functions | List of all members
icomp::CCompositeComponent Class Reference

#include <CCompositeComponent.h>

Inheritance diagram for icomp::CCompositeComponent:
icomp::CInterfaceManipBase icomp::ICompositeComponent istd::CIdManipBase icomp::IComponent istd::IPolymorphic

Public Member Functions

 CCompositeComponent (bool manualAutoInit)
 
virtual ~CCompositeComponent ()
 
template<class InterfaceType >
InterfaceType * GetComponentInterface (const QByteArray &subId="")
 Get interface implemented by this composite component. More...
 
bool EnsureAutoInitComponentsCreated () const
 Make sure, all components with flag 'AutoInit' are initialized. More...
 
virtual IComponentGetSubcomponent (const QByteArray &componentId) const
 Get access to subcomponent using its ID. More...
 
virtual const IComponentContextGetSubcomponentContext (const QByteArray &componentId) const
 Get access to context of subcomponent using its ID. More...
 
virtual IComponentCreateSubcomponent (const QByteArray &componentId) const
 Create instance of subcomponent using its ID. More...
 
virtual void OnSubcomponentDeleted (const IComponent *subcomponentPtr)
 Called if subcomponent is removed from memory. More...
 
virtual const ICompositeComponentGetParentComponent (bool ownerOnly=false) const
 Get parent of this component. More...
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="")
 Get access to specified component interface. More...
 
virtual const IComponentContextGetComponentContext () const
 Get access to component context describing all application-specified component information loaded from components registry. More...
 
virtual void SetComponentContext (const icomp::IComponentContext *contextPtr, const ICompositeComponent *parentPtr, bool isParentOwner)
 Set component context of this component. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Types

typedef istd::TDelPtr
< icomp::IComponent
ComponentPtr
 
typedef istd::TDelPtr
< icomp::IComponentContext
ContextPtr
 

Protected Member Functions

bool CreateSubcomponentInfo (const QByteArray &componentId, ContextPtr &subContextPtr, ComponentPtr *subComponentPtr, bool isOwned) const
 Create information objects and subcomponent. More...
 

Additional Inherited Members

- Static Public 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...
 
- Static Protected Member Functions inherited from icomp::CInterfaceManipBase
template<class Interface >
static Interface * ExtractInterface (IComponent *componentPtr, const QByteArray &subId="")
 Extract interface from component. More...
 

Detailed Description

Definition at line 25 of file CCompositeComponent.h.

Member Typedef Documentation

Definition at line 61 of file CCompositeComponent.h.

Definition at line 62 of file CCompositeComponent.h.

Constructor & Destructor Documentation

icomp::CCompositeComponent::CCompositeComponent ( bool  manualAutoInit)
virtual icomp::CCompositeComponent::~CCompositeComponent ( )
virtual

Member Function Documentation

virtual IComponent* icomp::CCompositeComponent::CreateSubcomponent ( const QByteArray &  componentId) const
virtual

Create instance of subcomponent using its ID.

Implements icomp::ICompositeComponent.

bool icomp::CCompositeComponent::CreateSubcomponentInfo ( const QByteArray &  componentId,
ContextPtr subContextPtr,
ComponentPtr subComponentPtr,
bool  isOwned 
) const
protected

Create information objects and subcomponent.

Parameters
componentIdID of subcomponent.
subContextPtrpointer to subcomponent context will be set to new context object if needed.
subComponentPtroptional pointer to subcomponent will be set to new component object.
isOwnedtrue, if created component will be owned by this component and should delegate its destroy event.
Returns
true if success.
bool icomp::CCompositeComponent::EnsureAutoInitComponentsCreated ( ) const

Make sure, all components with flag 'AutoInit' are initialized.

Returns
true, if there were components needed to be initialized.
virtual const IComponentContext* icomp::CCompositeComponent::GetComponentContext ( ) const
virtual

Get access to component context describing all application-specified component information loaded from components registry.

Implements icomp::IComponent.

Referenced by icomp::TComponentCloneWrap< BaseClass >::CloneMe().

template<class InterfaceType >
InterfaceType * icomp::CCompositeComponent::GetComponentInterface ( const QByteArray &  subId = "")
inline

Get interface implemented by this composite component.

Definition at line 120 of file CCompositeComponent.h.

References GetInterface().

Referenced by ipackage::CComponentAccessor::GetComponentInterface().

virtual void* icomp::CCompositeComponent::GetInterface ( const istd::CClassInfo interfaceType,
const QByteArray &  subId = "" 
)
virtual

Get access to specified component interface.

Parameters
interfaceTyperequested interface.
subIdsome additional ID to identify subelement of this component.

Implements icomp::IComponent.

Referenced by GetComponentInterface().

virtual const ICompositeComponent* icomp::CCompositeComponent::GetParentComponent ( bool  ownerOnly = false) const
virtual

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.

virtual IComponent* icomp::CCompositeComponent::GetSubcomponent ( const QByteArray &  componentId) const
virtual

Get access to subcomponent using its ID.

Implements icomp::ICompositeComponent.

Referenced by icomp::TComponentCloneWrap< BaseClass >::CloneMe().

virtual const IComponentContext* icomp::CCompositeComponent::GetSubcomponentContext ( const QByteArray &  componentId) const
virtual

Get access to context of subcomponent using its ID.

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

Implements icomp::ICompositeComponent.

virtual void icomp::CCompositeComponent::OnSubcomponentDeleted ( const IComponent subcomponentPtr)
virtual

Called if subcomponent is removed from memory.

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

Implements icomp::ICompositeComponent.

virtual void icomp::CCompositeComponent::SetComponentContext ( const icomp::IComponentContext contextPtr,
const ICompositeComponent parentPtr,
bool  isParentOwner 
)
virtual

Set component context of this component.

Parameters
contextPtrnew value of component context. It can be also NULL. Please avoid to use this method, it is designed for internal use only.
parentPtrpointer to parent component, or NULL if this component has no parent.
isParentOwnerindicate, that life cycle of this component is controller by its parent.

Implements icomp::IComponent.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy