![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Factory of components used as component member. More...
#include <TFactoryMember.h>
Public Types | |
typedef TAttributeMember< CFactoryAttribute > | BaseClass |
typedef CInterfaceManipBase | BaseClass2 |
typedef Interface | InterfaceType |
typedef istd::IFactoryInfo::KeyList | KeyList |
![]() | |
typedef CFactoryAttribute | AttributeType |
typedef CFactoryAttribute::ValueType | AttributeValueType |
typedef void | InterfaceType |
![]() | |
typedef Interface | InterfaceType |
![]() | |
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< IComponent > | CreateComponent () 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. | |
![]() | |
TAttributeMember () | |
void | Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo) |
Initialize this attribute. | |
bool | IsValid () const |
Check if this attribute is valid. | |
const CFactoryAttribute * | GetAttributePtr () const |
Access to internal attribute pointer. | |
const AttributeValueType & | GetOriginalValue () const |
Get value of attribute. | |
const CFactoryAttribute * | operator-> () const |
Access to internal attribute pointer. | |
bool | operator== (const CFactoryAttribute *ptr) const |
bool | operator!= (const CFactoryAttribute *ptr) const |
const AttributeValueType & | operator* () const |
Get value of attribute. | |
![]() | |
![]() |
Static Public Member Functions | |
static Interface * | ExtractInterface (istd::IPolymorphic *instancePtr, const QByteArray &subId="") |
Extract interface from some component. | |
![]() | |
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) | |
![]() | |
void | SetAttribute (const CFactoryAttribute *attributePtr) |
bool | InitInternal (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo, const IComponent **definitionComponentPtr) |
Internal initialize of attribute. | |
Additional Inherited Members | |
![]() | |
template<class Interface > | |
static Interface * | ExtractInterface (IComponent *componentPtr, const QByteArray &subId="") |
Extract interface from component. | |
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.
TAttributeMember<CFactoryAttribute> icomp::TFactoryMember< Interface >::BaseClass |
Definition at line 31 of file TFactoryMember.h.
CInterfaceManipBase icomp::TFactoryMember< Interface >::BaseClass2 |
Definition at line 32 of file TFactoryMember.h.
Interface icomp::TFactoryMember< Interface >::InterfaceType |
Definition at line 33 of file TFactoryMember.h.
istd::IFactoryInfo::KeyList icomp::TFactoryMember< Interface >::KeyList |
Definition at line 34 of file TFactoryMember.h.
icomp::TFactoryMember< Interface >::TFactoryMember | ( | ) |
Definition at line 81 of file TFactoryMember.h.
|
protected |
Definition at line 177 of file TFactoryMember.h.
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().
|
virtual |
Create an instance of the object, mapped to the keyId keyId
.
keyId |
Implements istd::TIFactory< Interface >.
Definition at line 127 of file TFactoryMember.h.
|
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.
instancePtr | pointer to component object, typically returned by method CreateComponent(). If it is nullptr, this function return also nullptr value. |
subId | optionally ID parameter identifing subcomponent. |
Definition at line 160 of file TFactoryMember.h.
|
virtual |
Returns all posible keys for this factory.
Implements istd::IFactoryInfo.
Definition at line 146 of file TFactoryMember.h.
void icomp::TFactoryMember< Interface >::Init | ( | const IComponent * | ownerPtr, |
const IRealAttributeStaticInfo & | staticInfo ) |
Definition at line 88 of file TFactoryMember.h.
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.
© Witold Gantzke and Kirill Lepskiy