Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
icomp::TMultiFactoryMember< Interface > Class Template Reference

Factory of components used as component member. More...

#include <TMultiFactoryMember.h>

Inheritance diagram for icomp::TMultiFactoryMember< Interface >:
icomp::TMultiAttributeMember< CMultiFactoryAttribute > icomp::CInterfaceManipBase istd::CIdManipBase

Public Types

typedef TMultiAttributeMember
< CMultiFactoryAttribute
BaseClass
 
typedef CInterfaceManipBase BaseClass2
 
typedef Interface InterfaceType
 
- Public Types inherited from icomp::TMultiAttributeMember< CMultiFactoryAttribute >
typedef CMultiFactoryAttribute AttributeType
 
typedef
CMultiFactoryAttribute::ValueType 
AttributeValueType
 
typedef void InterfaceType
 

Public Member Functions

 TMultiFactoryMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 
bool IsValid () const
 Check if this factory can be resolved. More...
 
IComponentCreateComponent (int index) const
 Create component for specified index without extracting any interface. More...
 
Interface * CreateInstance (int index) const
 Create instance of interface for specified index. More...
 
- Public Member Functions inherited from icomp::TMultiAttributeMember< CMultiFactoryAttribute >
 TMultiAttributeMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 Internal initialize of attribute. More...
 
bool IsValid () const
 Check if this attribute is valid. More...
 
int GetCount () const
 Get number of attributes. More...
 
const AttributeValueTypeoperator[] (int index) const
 Access to object pointed by internal pointer. More...
 
int FindValue (const AttributeValueType &value) const
 Find attribute value. More...
 

Static Public Member Functions

static Interface * ExtractInterface (IComponent *componentPtr, const QByteArray &subId="")
 Extract interface from some component. More...
 
- 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...
 

Protected Member Functions

 TMultiFactoryMember (const TMultiFactoryMember &ptr)
 
- Protected Member Functions inherited from icomp::TMultiAttributeMember< CMultiFactoryAttribute >
bool InitInternal (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo, const IComponent **definitionComponentPtr)
 

Additional Inherited Members

- 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

template<class Interface>
class icomp::TMultiFactoryMember< Interface >

Factory of components used as component member.

Don't use direct this class, use macros I_FACT and I_ASSIGN instead.

Definition at line 22 of file TMultiFactoryMember.h.

Member Typedef Documentation

template<class Interface >
typedef TMultiAttributeMember<CMultiFactoryAttribute> icomp::TMultiFactoryMember< Interface >::BaseClass

Definition at line 25 of file TMultiFactoryMember.h.

template<class Interface >
typedef CInterfaceManipBase icomp::TMultiFactoryMember< Interface >::BaseClass2

Definition at line 26 of file TMultiFactoryMember.h.

template<class Interface >
typedef Interface icomp::TMultiFactoryMember< Interface >::InterfaceType

Definition at line 27 of file TMultiFactoryMember.h.

Constructor & Destructor Documentation

template<class Interface >
icomp::TMultiFactoryMember< Interface >::TMultiFactoryMember ( )

Definition at line 74 of file TMultiFactoryMember.h.

template<class Interface >
icomp::TMultiFactoryMember< Interface >::TMultiFactoryMember ( const TMultiFactoryMember< Interface > &  ptr)
protected

Definition at line 148 of file TMultiFactoryMember.h.

Member Function Documentation

template<class Interface >
IComponent * icomp::TMultiFactoryMember< Interface >::CreateComponent ( int  index) const

Create component for specified index without extracting any interface.

Definition at line 96 of file TMultiFactoryMember.h.

References icomp::ICompositeComponent::CreateSubcomponent(), icomp::IComponent::GetParentComponent(), and NULL.

template<class Interface >
Interface * icomp::TMultiFactoryMember< Interface >::CreateInstance ( int  index) const

Create instance of interface for specified index.

This is combination of the methods CreateComponent and ExtractInterface provided for convinience, if only one interface is asked in factorisied objects.

Definition at line 120 of file TMultiFactoryMember.h.

References istd::TPointerBase< Type >::GetPtr(), istd::TPointerBase< Type >::IsValid(), NULL, and istd::TDelPtr< Type, Accessor >::PopPtr().

template<class Interface >
Interface * icomp::TMultiFactoryMember< Interface >::ExtractInterface ( IComponent componentPtr,
const QByteArray &  subId = "" 
)
static

Extract interface from some component.

Type of extracted interface is specified by template parameter of this class. If you want to force some factory to support more interfaces, you should simply define multiply I_FACT members with the same ID, factorise instances with any of them and extract specified interfaces using this method.

Parameters
componentPtrpointer to component object, typically returned by method CreateComponent().
subIdoptionally ID parameter identifing subcomponent.
Returns
pointer to interface or NULL, if such interface could not be extracted.

Definition at line 139 of file TMultiFactoryMember.h.

template<class Interface >
void icomp::TMultiFactoryMember< Interface >::Init ( const IComponent ownerPtr,
const IRealAttributeStaticInfo staticInfo 
)

Definition at line 81 of file TMultiFactoryMember.h.

template<class Interface >
bool icomp::TMultiFactoryMember< Interface >::IsValid ( ) const

Check if this factory can be resolved.

Please note, that it gives no guarantee, that objects can be factorised.

Definition at line 88 of file TMultiFactoryMember.h.

References NULL.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy