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