ICF 3.0.5.47
Technical documentation of ICF Libraries
icomp::TFactoryMember< Interface > Class Template Reference

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

#include <TFactoryMember.h>

Inheritance diagram for icomp::TFactoryMember< Interface >:
Collaboration diagram for icomp::TFactoryMember< Interface >:

Public Types

typedef TAttributeMember< CFactoryAttributeBaseClass
 
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.
 
std::unique_ptr< IComponentCreateComponent () const
 Create component without extracting any interface.
 
virtual std::unique_ptr< Interface > CreateInstance (const QByteArray &keyId="") const
 Create an instance of the object, mapped to the keyId keyId.
 
virtual KeyList GetFactoryKeys () const
 Returns all posible keys for this factory.
 
- Public Member Functions inherited from icomp::TAttributeMember< CFactoryAttribute >
 TAttributeMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 Initialize this attribute.
 
bool IsValid () const
 Check if this attribute is valid.
 
const CFactoryAttributeGetAttributePtr () const
 Access to internal attribute pointer.
 
const AttributeValueTypeGetOriginalValue () const
 Get value of attribute.
 
const CFactoryAttributeoperator-> () const
 Access to internal attribute pointer.
 
bool operator== (const CFactoryAttribute *ptr) const
 
bool operator!= (const CFactoryAttribute *ptr) const
 
const AttributeValueTypeoperator* () const
 Get value of attribute.
 
- Public Member Functions inherited from istd::TIFactory< Interface >
- Public Member Functions inherited from istd::IFactoryInfo

Static Public Member Functions

static Interface * ExtractInterface (istd::IPolymorphic *instancePtr, const QByteArray &subId="")
 Extract interface from some component.
 
- 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.
 
static QByteArray JoinId (const QByteArray &baseId, const QByteArray &subId)
 Join base component ID and sub ID into composed component ID.
 

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.
 

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.
 

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

Member Typedef Documentation

◆ BaseClass

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

Definition at line 31 of file TFactoryMember.h.

◆ BaseClass2

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

Definition at line 32 of file TFactoryMember.h.

◆ InterfaceType

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

Definition at line 33 of file TFactoryMember.h.

◆ KeyList

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

Definition at line 34 of file TFactoryMember.h.

Constructor & Destructor Documentation

◆ TFactoryMember() [1/2]

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

Definition at line 81 of file TFactoryMember.h.

◆ TFactoryMember() [2/2]

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

Definition at line 177 of file TFactoryMember.h.

Member Function Documentation

◆ CreateComponent()

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

Create component without extracting any interface.

Definition at line 103 of file TFactoryMember.h.

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

◆ CreateInstance()

template<class Interface >
std::unique_ptr< 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 nullptr if it was not possible to create it or keyId does not exist.

Implements istd::TIFactory< Interface >.

Definition at line 127 of file TFactoryMember.h.

◆ ExtractInterface()

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 nullptr, this function return also nullptr value.
subIdoptionally ID parameter identifing subcomponent.
Returns
pointer to interface or nullptr, if such interface could not be extracted.

Definition at line 160 of file TFactoryMember.h.

◆ GetFactoryKeys()

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

◆ Init()

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

Definition at line 88 of file TFactoryMember.h.

◆ IsValid()

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


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

© Witold Gantzke and Kirill Lepskiy