PLCnext API Documentation 23.6.0.37
|
This class is used by Acf libraries to provide a component factory of the library specific components. More...
#include <ComponentFactory.hpp>
Public Types | |
typedef IComponent::Ptr(* | FactoryMethod) (IApplication &application, const String &componentName) |
The prototype of the component factory method, which might be registered to create components. | |
Public Member Functions | |
bool | HasComponentType (const String &typeName) override |
Determines if this factory provides components of the given typename. More... | |
IComponent::Ptr | CreateComponent (IApplication &application, const String &componentType, const String &componentName) override |
Creates a component of the given typename. More... | |
bool | AddFactoryMethod (const String &componentType, FactoryMethod factoryMethod) |
Adds a component specific factory method to this factory. More... | |
![]() | |
IComponentFactory (void)=default | |
Constructs an IComponentFactory instance. | |
virtual | ~IComponentFactory (void)=default |
Destructs this instance and frees all resouces. | |
virtual bool | HasComponentType (const String &typeName)=0 |
Determines if this factory provides components of the given typename. More... | |
virtual IComponent::Ptr | CreateComponent (IApplication &application, const String &componentTypeName, const String &componentName)=0 |
Creates a component of the given typename. More... | |
This class is used by Acf libraries to provide a component factory of the library specific components.
This default implementation of the component factory should suffice in almost all cases.
|
inline |
Adds a component specific factory method to this factory.
componentType | The typename of the component to create. |
factoryMethod | The component factory method to create an new instance. |
true
if the factory method could be added, otherwise false
, when the factory method of the given component type yet exists.
|
overridevirtual |
Creates a component of the given typename.
application | The application passed to the new created component. |
componentTypeName | The typename of the component to create. |
componentName | The name of the new created component. |
nullptr
.Implements Arp::System::Acf::IComponentFactory.
|
inlineoverridevirtual |
Determines if this factory provides components of the given typename.
typeName | The name of the component type to search for. |
true
if the specifeid type could be provided, otherwise false
.Implements Arp::System::Acf::IComponentFactory.