PLCnext API Documentation 23.6.0.37
|
This is the most important basic interface of the Arp platform. Any component shall implement this interface. The Acf will use this interface to load, set up and dispose components during system startup and shutdown, respectively. If the component has its own threads, it shall implement the IControllerComponent interface, to start and stop them. More...
#include <IComponent.hpp>
Public Types | |
typedef std::shared_ptr< IComponent > | Ptr |
The pointer type of this interface. | |
typedef std::map< String, IComponent::Ptr > | Dictionary |
A map of components where the key is the name of the component. | |
Public Member Functions | |
virtual IApplication & | GetApplication (void) const =0 |
Gets the applicatopn instance of the actual process which loaded this component. More... | |
virtual ILibrary & | GetLibrary (void) const =0 |
Gets the library instance of this component. More... | |
virtual String | GetFullName (void) const =0 |
Gets the full qualified name of this component More... | |
virtual Version | GetVersion (void) const =0 |
Gets the version of this component which defaults to the build version of the related library. More... | |
virtual ComponentCategory | GetComponentCategory (void) const =0 |
Gets the ComponentCategory of this component. More... | |
virtual uint32 | GetStartOrder (void) const =0 |
Gets the start order of this component. More... | |
virtual bool | IsSingleton (void) const =0 |
Determines if this component is a singleton, that is, it's instantiated only once on the entire system. More... | |
virtual bool | IsRequired (void) const =0 |
Determines if this component is required. More... | |
virtual void | Initialize (void)=0 |
Initializes this component: creates singletons, makes any registrations, creates any resources not depending on settings or configuration. More... | |
virtual void | SubscribeServices (void)=0 |
Subscribes services required by this component. More... | |
virtual void | LoadSettings (const String &settingsPath)=0 |
Loads components firmware settings. More... | |
virtual void | SetupSettings (void)=0 |
Sets up components settings which were loaded in LoadSettings. More... | |
virtual void | PublishServices (void)=0 |
Publishes components services. More... | |
virtual void | LoadConfig (void)=0 |
Loads components project configuration. More... | |
virtual void | SetupConfig (void)=0 |
Sets up components configuration which was loaded in LoadConfig. More... | |
virtual void | ResetConfig (void)=0 |
Resets components project configuration. More... | |
virtual void | Dispose (void)=0 |
Disposes component. More... | |
virtual void | PowerDown (void)=0 |
This operation is called on a power breakdown event and executes component specific actions when power get lost. More... | |
Protected Member Functions | |
IComponent (void)=default | |
The default constructor. | |
virtual | ~IComponent (void)=default |
The default destructor. | |
This is the most important basic interface of the Arp platform. Any component shall implement this interface. The Acf will use this interface to load, set up and dispose components during system startup and shutdown, respectively. If the component has its own threads, it shall implement the IControllerComponent interface, to start and stop them.
The Arp platform architecture is component based, that means, any functionality, data or other resources are brought into the system through a (Acf) component. Any customer shall implement a subset of the operations of this interface to add its own applicative functionality. The most system components of the Arp platform also use and implement this design. Thus, the extensibility and customizability of the Arp platform is based on the IComponent interface.
The Arp system startup consists of 3 phases:
During the firmware setup for all components according to the start order the following operations are called in the given order
If any operation fails and the related component is required, the firmware shuts down with an error and the controller is not accessible. If the related component is not required. it's unloaded and the firmware startup continues.
During the project setup for all components according to the start order the following operations are called in the given order
If any operation fails the configuration is unloaded for all components and the controller starts with an empty configuration.
During the components start for all components implementing the IControllerComponent interface according to the start order the IControllerComponent::Start operation is called.
The Arp system shutdown consists of 3 phases:
During the components stop for all components implementing the IControllerComponent interface according to the reversed start order the IControllerComponent::Stop operation is called.
During the project reset for all components according to the reversed start order the ResetConfig operation is called. If any operation fails the exception is logged out and the the shutdown continues.
During the firmware dispose for all components according to the reversed start order the Dispose operations is called. If any operation fails the exception is logged out and the the shutdown continues.
In case of a supply voltage failure the method is called. The operation is only called for devices that can detect a supply voltage failure (e.g. AXC F 3152 or RFC4072S).
|
pure virtual |
Disposes component.
This operation is called after ResetConfig during the system shutdown. Important: This operation shall be implemented inverse (asymmetrical) to SetupSettings, LoadSettings and Initialize.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Gets the applicatopn instance of the actual process which loaded this component.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Gets the ComponentCategory of this component.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Gets the full qualified name of this component
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Gets the library instance of this component.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Gets the start order of this component.
The start order determines the order in which the components are set up and started. The components will be stooped and disposed in reversed start order.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Gets the version of this component which defaults to the build version of the related library.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Initializes this component: creates singletons, makes any registrations, creates any resources not depending on settings or configuration.
This operation is called first during the firmware setup.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Determines if this component is required.
true
if this component is a required, otherwise false
.Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Determines if this component is a singleton, that is, it's instantiated only once on the entire system.
true
if this component is a singleton, otherwise false
.Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Loads components project configuration.
This operation is called after PublishServices and first during the project setup.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Loads components firmware settings.
This operation is called after SubscribeServices during the firmware setup.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
This operation is called on a power breakdown event and executes component specific actions when power get lost.
This operation is extremly time critical and must only execute absolute necessarily actions, e.g. the RetainComponent will save its retain data when this event occurs. For components loaded by the Program Library Manager (Plm) this method is called in firmware from version 2021.6 onwards.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Publishes components services.
This operation is called after SetupSettings during the project setup.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Resets components project configuration.
This operation is called first during the system shutdown. Important: This operation shall be implemented inverse (asymmetrical) to SetupConfig and LoadConfig.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Sets up components configuration which was loaded in LoadConfig.
This operation is called after LoadConfig during the project setup.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Sets up components settings which were loaded in LoadSettings.
This operation is called after LoadSettings during the firmware setup.
Implemented in Arp::System::Acf::ComponentBase.
|
pure virtual |
Subscribes services required by this component.
This operation is called after Initialize during the firmware setup.
Implemented in Arp::System::Acf::ComponentBase.