PLCnext API Documentation 25.0.2.69
IComponent.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
7#ifndef ARP_USE_ARP_SYSTEM_ACF_COMMONS
8#include "Arp/Base/Acf/Commons/IComponent.hpp"
9#include "Arp/Base/Acf/Commons/ILibrary.hpp"
10namespace Arp::System::Acf
11{
13}
14#else
15#include "Arp/System/Core/Arp.h"
16#include "Arp/Base/Core/ArpVersion.hpp"
17#include "Arp/System/Acf/ILibrary.hpp"
18#include "Arp/System/Acf/ComponentCategory.hpp"
19#include <map>
20#include <memory>
21
22namespace Arp { namespace System { namespace Acf
23{
24
25// forwards
26class IApplication;
27class IControllerComponent; // for doxygen only
28
89class IComponent
90{
91public: // typedefs
93 typedef std::shared_ptr<IComponent> Ptr;
95 typedef std::map<String, IComponent::Ptr> Dictionary;
96
97protected: // construction/destruction
99 IComponent(void) = default;
101 virtual ~IComponent(void) = default;
102
103public: // abstract property getter to override
105 virtual IApplication& GetApplication(void)const = 0;
107 virtual ILibrary& GetLibrary(void)const = 0;
110 virtual String GetFullName(void)const = 0;
114 virtual ArpVersion GetVersion(void)const = 0;
117 virtual ComponentCategory GetComponentCategory(void)const = 0;
124 virtual uint32 GetStartOrder(void) const = 0;
127 virtual bool IsSingleton(void)const = 0;
130 virtual bool IsRequired(void)const = 0;
131
132public: // abstract operations to override
135 virtual void Initialize(void) = 0;
138 virtual void SubscribeServices(void) = 0;
141 virtual void LoadSettings(const String& settingsPath) = 0;
144 virtual void SetupSettings(void) = 0;
147 virtual void PublishServices(void) = 0;
150 virtual void LoadConfig(void) = 0;
153 virtual void SetupConfig(void) = 0;
159 virtual void ResetConfig(void) = 0;
166 virtual void Dispose(void) = 0;
173 virtual void PowerDown(void) = 0;
174
175private: // methods
176 IComponent(const IComponent& arg) = delete;
177 IComponent& operator=(const IComponent& arg) = delete;
178};
179
181// inline methods of class IComponent
182
183}}} // end of namesapce Arp::System::Acf
184
185#endif // ndef ARP_USE_ARP_SYSTEM_ACF_COMMONS
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.
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.
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.
virtual ILibrary & GetLibrary(void) const =0
Gets the library instance of this component.
std::shared_ptr< IComponent > Ptr
The pointer type of this interface.
Definition: IComponent.hpp:83
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
Root namespace for the PLCnext API