ACF $AcfVersion:0$
Public Member Functions | List of all members
icomp::TSimComponentsFactory< Base > Class Template Reference

Simulation wrapper of component. More...

#include <TSimComponentsFactory.h>

Inheritance diagram for icomp::TSimComponentsFactory< Base >:
istd::TIFactory< icomp::IComponent > icomp::ICompositeComponent istd::IFactoryInfo icomp::IComponent istd::IPolymorphic istd::IPolymorphic

Public Member Functions

 TSimComponentsFactory ()
 
TSimComponentWrap< Base > * operator-> ()
 
virtual istd::IFactoryInfo::KeyList GetFactoryKeys () const override
 Returns all possible keys for this factory.
 
virtual istd::TUniqueInterfacePtr< icomp::IComponentCreateInstance (const QByteArray &keyId="") const override
 Create an instance of the object, mapped to the keyId keyId.
 
virtual IComponentSharedPtr GetSubcomponent (const QByteArray &componentId) const override
 Get access to subcomponent using its ID.
 
virtual IComponentContextSharedPtr GetSubcomponentContext (const QByteArray &componentId) const override
 Get access to context of subcomponent using its ID.
 
virtual IComponentUniquePtr CreateSubcomponent (const QByteArray &componentId) const override
 Create instance of subcomponent using its ID.
 
virtual void OnSubcomponentDeleted (const IComponent *subcomponentPtr) override
 Called if subcomponent is removed from memory.
 
virtual const icomp::IComponentGetParentComponent (bool ownerOnly=false) const override
 Get parent of this component.
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="") override
 Get access to specified component interface.
 
virtual icomp::IComponentContextSharedPtr GetComponentContext () const override
 Get access to component context describing all application-specified component information loaded from components registry.
 
virtual void SetComponentContext (const icomp::IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner) override
 Set component context of this component.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Additional Inherited Members

- Public Types inherited from istd::TIFactory< icomp::IComponent >
typedef icomp::IComponent InterfaceType
 
- Public Types inherited from istd::IFactoryInfo
typedef QSet< QByteArray > KeyList
 

Detailed Description

template<class Base>
class icomp::TSimComponentsFactory< Base >

Simulation wrapper of component.

It allows to use components directly from static linked libraries, without component framework.

Definition at line 24 of file TSimComponentsFactory.h.

Constructor & Destructor Documentation

◆ TSimComponentsFactory()

template<class Base >
icomp::TSimComponentsFactory< Base >::TSimComponentsFactory ( )

Member Function Documentation

◆ CreateInstance()

template<class Base >
istd::TUniqueInterfacePtr< icomp::IComponent > icomp::TSimComponentsFactory< Base >::CreateInstance ( const QByteArray &  keyId = "") const
overridevirtual

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

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

Implements istd::TIFactory< icomp::IComponent >.

Definition at line 82 of file TSimComponentsFactory.h.

References icomp::IComponent::SetComponentContext().

◆ CreateSubcomponent()

template<class Base >
icomp::IComponentUniquePtr icomp::TSimComponentsFactory< Base >::CreateSubcomponent ( const QByteArray &  componentId) const
overridevirtual

Create instance of subcomponent using its ID.

Implements icomp::ICompositeComponent.

Definition at line 114 of file TSimComponentsFactory.h.

References NULL.

◆ GetComponentContext()

template<class Base >
icomp::IComponentContextSharedPtr icomp::TSimComponentsFactory< Base >::GetComponentContext ( ) const
overridevirtual

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

Implements icomp::IComponent.

Definition at line 149 of file TSimComponentsFactory.h.

◆ GetFactoryKeys()

template<class Base >
istd::IFactoryInfo::KeyList icomp::TSimComponentsFactory< Base >::GetFactoryKeys ( ) const
overridevirtual

Returns all possible keys for this factory.

Retrieves the complete set of keys (identifiers) that this factory can use to create objects. Each key corresponds to a specific object type or variant that the factory knows how to instantiate.

Returns
A QSet containing all valid factory keys. The set may be empty if the factory cannot currently create any objects, but typically contains at least one key for factories that are properly configured.
Note
The returned set represents a snapshot of available keys at the time of the call. For dynamic factories, the available keys may change over time (e.g., through plugin loading).
Keys are typically case-sensitive QByteArray values. Clients should use exact string matching when working with factory keys.
// Example usage
IFactoryInfo* factory = GetFactory();
IFactoryInfo::KeyList keys = factory->GetFactoryKeys();
// Check if a specific type is available
if (keys.contains("mytype")) {
// Create object using "mytype" key
}
// List all available types
for (const QByteArray& key : keys) {
qDebug() << "Available type:" << key;
}
See also
istd::IFactory::CreateInstance()

Implements istd::IFactoryInfo.

Definition at line 73 of file TSimComponentsFactory.h.

◆ GetInterface()

template<class Base >
void * icomp::TSimComponentsFactory< Base >::GetInterface ( const istd::CClassInfo interfaceType,
const QByteArray &  subId = "" 
)
overridevirtual

Get access to specified component interface.

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

Implements icomp::IComponent.

Definition at line 142 of file TSimComponentsFactory.h.

References icomp::IComponent::GetInterface().

◆ GetParentComponent()

template<class Base >
const icomp::IComponent * icomp::TSimComponentsFactory< Base >::GetParentComponent ( bool  ownerOnly = false) const
overridevirtual

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.

Definition at line 135 of file TSimComponentsFactory.h.

References icomp::IComponent::GetParentComponent().

◆ GetSubcomponent()

template<class Base >
icomp::IComponentSharedPtr icomp::TSimComponentsFactory< Base >::GetSubcomponent ( const QByteArray &  componentId) const
overridevirtual

Get access to subcomponent using its ID.

Implements icomp::ICompositeComponent.

Definition at line 100 of file TSimComponentsFactory.h.

◆ GetSubcomponentContext()

template<class Base >
icomp::IComponentContextSharedPtr icomp::TSimComponentsFactory< Base >::GetSubcomponentContext ( const QByteArray &  componentId) const
overridevirtual

Get access to context of subcomponent using its ID.

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

Implements icomp::ICompositeComponent.

Definition at line 107 of file TSimComponentsFactory.h.

◆ OnSubcomponentDeleted()

template<class Base >
void icomp::TSimComponentsFactory< Base >::OnSubcomponentDeleted ( const IComponent subcomponentPtr)
overridevirtual

Called if subcomponent is removed from memory.

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

Implements icomp::ICompositeComponent.

Definition at line 126 of file TSimComponentsFactory.h.

◆ operator->()

template<class Base >
TSimComponentWrap< Base > * icomp::TSimComponentsFactory< Base >::operator-> ( )
inline

Definition at line 29 of file TSimComponentsFactory.h.

◆ SetComponentContext()

template<class Base >
void icomp::TSimComponentsFactory< Base >::SetComponentContext ( const icomp::IComponentContextSharedPtr contextPtr,
const icomp::IComponent parentPtr,
bool  isParentOwner 
)
overridevirtual

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.

Definition at line 156 of file TSimComponentsFactory.h.


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