PLCnext API Documentation 25.0.2.69
IComponentFactory.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Acf/Commons/IComponent.hpp"
9
10namespace Arp::Base::Acf::Commons
11{
12
19class ARP_EXPORT IComponentFactory
20{
21public: // usings
22
24 using FactoryMethod = IComponent::Ptr(*)(ILibrary& library, const String& componentName);
25
27 using FactoryMethodCompat = IComponent::Ptr(*)(Application& application, const String& componentName);
28
29public: // construction/destruction
30
32 IComponentFactory(void) = default;
33
36 IComponentFactory(IComponentFactory&& arg)noexcept = default;
37
41
46
51
53 virtual ~IComponentFactory(void) = default;
54
55public: // interface operations
56
60 virtual bool HasComponentType(const String& typeName) = 0;
61
66 virtual IComponent::Ptr CreateComponent(const String& typeName, const String& componentName) = 0;
67};
68
69} // end of namespace Arp::System::Acf
70
71namespace Arp::System::Acf
72{
74}
This class provides some system functionality and infos.
Definition: Application.hpp:17
This interface is used by the Acf to create components dynamically through configuration (....
Definition: IComponentFactory.hpp:20
IComponentFactory & operator=(IComponentFactory &&arg) noexcept=default
The move assignment operator.
virtual ~IComponentFactory(void)=default
The virtual default destructor.
IComponent::Ptr(*)(ILibrary &library, const String &componentName) FactoryMethod
The prototype of the component factory method, which might be registered to create components.
Definition: IComponentFactory.hpp:24
IComponentFactory(void)=default
The default constructor.
virtual bool HasComponentType(const String &typeName)=0
Determines if this factory provides components of the given type-name.
IComponentFactory(const IComponentFactory &arg)=delete
The copy constructor is deleted.
IComponent::Ptr(*)(Application &application, const String &componentName) FactoryMethodCompat
The deprecated prototype of the component factory method, which might be registered to create compone...
Definition: IComponentFactory.hpp:27
virtual IComponent::Ptr CreateComponent(const String &typeName, const String &componentName)=0
Creates a component of the given type-name.
IComponentFactory & operator=(const IComponentFactory &arg)=delete
The copy assignment operator is deleted.
IComponentFactory(IComponentFactory &&arg) noexcept=default
The move constructor.
std::shared_ptr< IComponent > Ptr
The pointer type of this interface.
Definition: IComponent.hpp:83
Any Acf Library shall implement this interface.
Definition: ILibrary.hpp:20
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
This is the namespace of the Application Component Framework.
Definition: ComponentBase.hpp:72