PLCnext API Documentation 23.6.0.37
IComponent.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Acf/ILibrary.hpp"
9#include "Arp/System/Acf/ComponentCategory.hpp"
10#include <map>
11#include <memory>
12
13namespace Arp { namespace System { namespace Acf
14{
15
16// forwards
17class IApplication;
18class IControllerComponent; // for doxygen only
19
81{
82public: // typedefs
84 typedef std::shared_ptr<IComponent> Ptr;
86 typedef std::map<String, IComponent::Ptr> Dictionary;
87
88protected: // construction/destruction
90 IComponent(void) = default;
92 virtual ~IComponent(void) = default;
93
94public: // abstract property getter to override
96 virtual IApplication& GetApplication(void)const = 0;
98 virtual ILibrary& GetLibrary(void)const = 0;
101 virtual String GetFullName(void)const = 0;
105 virtual Version GetVersion(void)const = 0;
115 virtual uint32 GetStartOrder(void) const = 0;
118 virtual bool IsSingleton(void)const = 0;
121 virtual bool IsRequired(void)const = 0;
122
123public: // abstract operations to override
126 virtual void Initialize(void) = 0;
129 virtual void SubscribeServices(void) = 0;
132 virtual void LoadSettings(const String& settingsPath) = 0;
135 virtual void SetupSettings(void) = 0;
138 virtual void PublishServices(void) = 0;
141 virtual void LoadConfig(void) = 0;
144 virtual void SetupConfig(void) = 0;
150 virtual void ResetConfig(void) = 0;
157 virtual void Dispose(void) = 0;
164 virtual void PowerDown(void) = 0;
165
166private: // methods
167 IComponent(const IComponent& arg) = delete;
168 IComponent& operator=(const IComponent& arg) = delete;
169};
170
172// inline methods of class IComponent
173
174}}} // end of namesapce Arp::System::Acf
This class represents the version of a special SDK or Arp build.
Definition: BasicVersion.hpp:36
This interface shall be implemented by the application class.
Definition: IApplication.hpp:19
This is the most important basic interface of the Arp platform. Any component shall implement this in...
Definition: IComponent.hpp:81
virtual void ResetConfig(void)=0
Resets components project configuration.
virtual ILibrary & GetLibrary(void) const =0
Gets the library instance of this component.
IComponent(void)=default
The default constructor.
virtual void SubscribeServices(void)=0
Subscribes services required by this component.
virtual void PublishServices(void)=0
Publishes components services.
virtual void LoadConfig(void)=0
Loads components project configuration.
virtual void SetupConfig(void)=0
Sets up components configuration which was loaded in LoadConfig.
virtual String GetFullName(void) const =0
Gets the full qualified name of this component
virtual ComponentCategory GetComponentCategory(void) const =0
Gets the ComponentCategory of this component.
virtual void SetupSettings(void)=0
Sets up components settings which were loaded in LoadSettings.
std::shared_ptr< IComponent > Ptr
The pointer type of this interface.
Definition: IComponent.hpp:84
virtual void Initialize(void)=0
Initializes this component: creates singletons, makes any registrations, creates any resources not de...
virtual bool IsRequired(void) const =0
Determines if this component is required.
virtual void PowerDown(void)=0
This operation is called on a power breakdown event and executes component specific actions when powe...
virtual void LoadSettings(const String &settingsPath)=0
Loads components firmware settings.
virtual uint32 GetStartOrder(void) const =0
Gets the start order of this component.
std::map< String, IComponent::Ptr > Dictionary
A map of components where the key is the name of the component.
Definition: IComponent.hpp:86
virtual Version GetVersion(void) const =0
Gets the version of this component which defaults to the build version of the related library.
virtual void Dispose(void)=0
Disposes component.
virtual bool IsSingleton(void) const =0
Determines if this component is a singleton, that is, it's instantiated only once on the entire syste...
virtual ~IComponent(void)=default
The default destructor.
virtual IApplication & GetApplication(void) const =0
Gets the applicatopn instance of the actual process which loaded this component.
Any Acf Library shall implement this interface.
Definition: ILibrary.hpp:22
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:36
ComponentCategory
This enumeration determines the category of a component.
Definition: ComponentCategory.hpp:17
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API