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

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

#include <TFactoryMember.h>

Inheritance diagram for icomp::TFactoryMember< Interface >:
icomp::TAttributeMember< CFactoryAttribute > icomp::CInterfaceManipBase istd::TIFactory< Interface > istd::CIdManipBase istd::IFactoryInfo istd::IPolymorphic

Public Types

typedef TAttributeMember
< CFactoryAttribute
BaseClass
 
typedef CInterfaceManipBase BaseClass2
 
typedef Interface InterfaceType
 
typedef istd::IFactoryInfo::KeyList KeyList
 
- Public Types inherited from icomp::TAttributeMember< CFactoryAttribute >
typedef CFactoryAttribute AttributeType
 
typedef
CFactoryAttribute::ValueType 
AttributeValueType
 
typedef void InterfaceType
 
- Public Types inherited from istd::TIFactory< Interface >
typedef Interface InterfaceType
 
- Public Types inherited from istd::IFactoryInfo
typedef QSet< QByteArray > KeyList
 

Public Member Functions

 TFactoryMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 
bool IsValid () const
 Check if this factory can be resolved. More...
 
IComponentCreateComponent () const
 Create component without extracting any interface. More...
 
virtual Interface * CreateInstance (const QByteArray &keyId="") const
 Create an instance of the object, mapped to the keyId keyId. More...
 
virtual KeyList GetFactoryKeys () const
 Returns all posible keys for this factory. More...
 
- Public Member Functions inherited from icomp::TAttributeMember< CFactoryAttribute >
 TAttributeMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 Initialize this attribute. More...
 
bool IsValid () const
 Check if this attribute is valid. More...
 
const CFactoryAttributeGetAttributePtr () const
 Access to internal attribute pointer. More...
 
const AttributeValueTypeGetOriginalValue () const
 Get value of attribute. More...
 
const CFactoryAttributeoperator-> () const
 Access to internal attribute pointer. More...
 
const AttributeValueTypeoperator* () const
 Get value of attribute. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Static Public Member Functions

static Interface * ExtractInterface (istd::IPolymorphic *instancePtr, 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

 TFactoryMember (const TFactoryMember &ptr)
 
- Protected Member Functions inherited from icomp::TAttributeMember< CFactoryAttribute >
void SetAttribute (const CFactoryAttribute *attributePtr)
 
bool InitInternal (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo, const IComponent **definitionComponentPtr)
 Internal initialize of attribute. More...
 

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::TFactoryMember< 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 23 of file TFactoryMember.h.

Member Typedef Documentation

template<class Interface >
typedef TAttributeMember<CFactoryAttribute> icomp::TFactoryMember< Interface >::BaseClass

Definition at line 29 of file TFactoryMember.h.

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

Definition at line 30 of file TFactoryMember.h.

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

Definition at line 31 of file TFactoryMember.h.

template<class Interface >
typedef istd::IFactoryInfo::KeyList icomp::TFactoryMember< Interface >::KeyList

Definition at line 32 of file TFactoryMember.h.

Constructor & Destructor Documentation

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

Definition at line 79 of file TFactoryMember.h.

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

Definition at line 176 of file TFactoryMember.h.

Member Function Documentation

template<class Interface >
IComponent * icomp::TFactoryMember< Interface >::CreateComponent ( ) const

Create component without extracting any interface.

Definition at line 101 of file TFactoryMember.h.

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

template<class Interface >
Interface * icomp::TFactoryMember< Interface >::CreateInstance ( const QByteArray &  keyId = "") const
virtual

Create an instance of the object, mapped to the keyId keyId.

Parameters
keyId
Returns
pointer to created object or NULL if it was not possible to create it or keyId does not exist.

Implements istd::TIFactory< Interface >.

Definition at line 125 of file TFactoryMember.h.

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

template<class Interface >
Interface * icomp::TFactoryMember< Interface >::ExtractInterface ( istd::IPolymorphic instancePtr,
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
instancePtrpointer to component object, typically returned by method CreateComponent(). If it is NULL, this function return also NULL value.
subIdoptionally ID parameter identifing subcomponent.
Returns
pointer to interface or NULL, if such interface could not be extracted.

Definition at line 158 of file TFactoryMember.h.

References NULL.

template<class Interface >
istd::IFactoryInfo::KeyList icomp::TFactoryMember< Interface >::GetFactoryKeys ( ) const
virtual

Returns all posible keys for this factory.

Implements istd::IFactoryInfo.

Definition at line 144 of file TFactoryMember.h.

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

Definition at line 86 of file TFactoryMember.h.

template<class Interface >
bool icomp::TFactoryMember< 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 93 of file TFactoryMember.h.

References NULL.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy