PLCnext API Documentation 25.0.2.69
IComponent.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/ArpVersion.hpp"
9#include "Arp/Base/Acf/Commons/ComponentCategory.hpp"
10#include "Arp/Base/Acf/Commons/ComponentInfoKind.hpp"
11
12namespace Arp::Base::Acf::Commons
13{
14
15// forwards
16class ILibrary;
17class Application;
18class IControllerComponent; // for doxygen only, caused by see-also hint
19
78class ARP_EXPORT IComponent
79{
80public: // usings
81
83 using Ptr = std::shared_ptr<IComponent>;
84
85protected: // construction/destruction
86
88 IComponent(void) = default;
89
90public: // construction/destruction
91
94 IComponent(IComponent&& arg)noexcept = default;
95
98 IComponent(const IComponent& arg) = delete;
99
103 IComponent& operator=(IComponent&& arg)noexcept = default;
104
108 IComponent& operator=(const IComponent& arg) = delete;
109
111 virtual ~IComponent(void) = default;
112
113public: // abstract property getter to override
114
117 virtual Application& GetApplication(void)const = 0;
118
121 virtual ILibrary& GetLibrary(void)const = 0;
122
125 virtual String GetFullName(void)const = 0;
126
129 virtual ComponentCategory GetComponentCategory(void)const = 0;
130
137 virtual uint32 GetStartOrder(void)const = 0;
138
141 virtual bool IsRequired(void)const = 0;
142
146 virtual String GetComponentInfoItem(ComponentInfoKind kind) const = 0;
147
148public: // abstract operations to override
149
152 virtual void Initialize(void) = 0;
153
156 virtual void SubscribeServices(void) = 0;
157
161 virtual void LoadSettings(const String& settingsPath) = 0;
162
165 virtual void SetupSettings(void) = 0;
166
169 virtual void PublishServices(void) = 0;
170
173 virtual void LoadConfig(void) = 0;
174
180 virtual void SetupConfig(void) = 0;
181
187 virtual void ResetConfig(void) = 0;
188
195 virtual void Dispose(void) = 0;
196
203 virtual void PowerDown(void) = 0;
204};
205
206} // end of namespace Arp::System::Acf::Commons
207
208namespace Arp::System::Acf
209{
211}
This class provides some system functionality and infos.
Definition: Application.hpp:17
This is the most important basic interface of the Arp platform. Any component shall implement this in...
Definition: IComponent.hpp:79
virtual void Initialize(void)=0
Initializes this component: creates singletons, makes any registrations, creates any resources not de...
virtual uint32 GetStartOrder(void) const =0
Gets the start order of this component.
virtual ComponentCategory GetComponentCategory(void) const =0
Gets the ComponentCategory of this component.
virtual void Dispose(void)=0
Disposes this component.
virtual void PowerDown(void)=0
This operation is called on a power breakdown event and executes component specific actions when powe...
virtual void PublishServices(void)=0
Publishes components services.
virtual bool IsRequired(void) const =0
Determines if this component is required.
virtual void LoadConfig(void)=0
Loads components project configuration.
IComponent(const IComponent &arg)=delete
The copy constructor is deleted.
virtual void LoadSettings(const String &settingsPath)=0
Loads components firmware settings.
IComponent(void)=default
The default constructor.
virtual String GetFullName(void) const =0
Gets the full qualified name of this component
virtual ~IComponent(void)=default
The virtual default destructor.
virtual void SetupSettings(void)=0
Sets up components settings which were loaded in LoadSettings.
IComponent & operator=(const IComponent &arg)=delete
The copy assignment operator is deleted.
virtual void SubscribeServices(void)=0
Subscribes services required by this component.
IComponent & operator=(IComponent &&arg) noexcept=default
The move assignment operator.
virtual Application & GetApplication(void) const =0
Gets the application instance of the actual process which loaded this component.
virtual void ResetConfig(void)=0
Resets components project configuration.
virtual void SetupConfig(void)=0
Sets up components configuration which was loaded in LoadConfig.
IComponent(IComponent &&arg) noexcept=default
The move constructor.
virtual ILibrary & GetLibrary(void) const =0
Gets the library instance of this component.
virtual String GetComponentInfoItem(ComponentInfoKind kind) const =0
Gets additional information about the component
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
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:33
This is the namespace of the Application Component Framework.
Definition: ComponentBase.hpp:72