PLCnext API Documentation 25.0.2.69
|
This is the most important basic interface of the Arp platform. Any component shall implement this interface. More...
#include <IComponent.hpp>
Public Types | |
using | Ptr = std::shared_ptr< IComponent > |
The pointer type of this interface. | |
Public Member Functions | |
IComponent (IComponent &&arg) noexcept=default | |
The move constructor. More... | |
IComponent (const IComponent &arg)=delete | |
The copy constructor is deleted. More... | |
IComponent & | operator= (IComponent &&arg) noexcept=default |
The move assignment operator. More... | |
IComponent & | operator= (const IComponent &arg)=delete |
The copy assignment operator is deleted. More... | |
virtual | ~IComponent (void)=default |
The virtual default destructor. | |
virtual Application & | GetApplication (void) const =0 |
Gets the application 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 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 | IsRequired (void) const =0 |
Determines if this component is required. More... | |
virtual String | GetComponentInfoItem (ComponentInfoKind kind) const =0 |
Gets additional information about the component 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 this 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. | |
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, i.e. 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 customisability 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 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 shutdown continues.
In case of a supply voltage failure the method PowerDown is called. The operation is only called for devices that can detect a supply voltage failure (e.g. AXC F 3152 or RFC4072S).
|
defaultnoexcept |
The move constructor.
arg | The argument to move. |
|
delete |
The copy constructor is deleted.
arg | The argument to copy. |
|
pure virtual |
Disposes this component.
This operation is called after ResetConfig during the system shutdown. Important: This operation shall be implemented inverse (antisymmetric) to SetupSettings, LoadSettings and Initialize.
Implemented in Arp::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Gets the application instance of the actual process which loaded this component.
Implemented in Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Gets the ComponentCategory of this component.
Implemented in Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Gets additional information about the component
kind | Kind of information to get |
Implemented in Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Gets the full qualified name of this component
Implemented in Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Gets the library instance of this component.
Implemented in Arp::Base::Acf::Commons::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 through the Acf. The components will be stopped and disposed in reversed start order.
Implemented in Arp::Base::Acf::Commons::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::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Determines if this component is required.
true
if this component is a required, otherwise false
.Implemented in Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Loads components project configuration.
This operation is called after PublishServices and first during the project setup.
Implemented in Arp::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Loads components firmware settings.
settingsPath | The path of the components settings file to load. |
This operation is called after SubscribeServices during the firmware setup.
Implemented in Arp::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
delete |
The copy assignment operator is deleted.
arg | The argument to copy. |
|
defaultnoexcept |
The move assignment operator.
arg | The argument to move. |
|
pure virtual |
This operation is called on a power breakdown event and executes component specific actions when power get lost.
This operation is extremely 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::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Publishes components services.
This operation is called after SetupSettings during the project setup.
Implemented in Arp::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Resets components project configuration.
This operation is called first during the system shutdown. Important: This operation shall be implemented inverse (antisymmetric) to SetupConfig and LoadConfig.
Implemented in Arp::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Sets up components configuration which was loaded in LoadConfig.
This operation is called after LoadConfig during the project setup. if there is any path to required, it shall be provided by the components settings file.
Implemented in Arp::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::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::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.
|
pure virtual |
Subscribes services required by this component.
This operation is called after Initialize during the firmware setup.
Implemented in Arp::Io::Commons::IoComponentBase, and Arp::Base::Acf::Commons::ComponentBase.