PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | Protected Member Functions | List of all members
Arp::Base::Acf::Commons::IComponent Class Referenceabstract

This is the most important basic interface of the Arp platform. Any component shall implement this interface. More...

#include <IComponent.hpp>

Inheritance diagram for Arp::Base::Acf::Commons::IComponent:
Inheritance graph

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...
 
IComponentoperator= (IComponent &&arg) noexcept=default
 The move assignment operator. More...
 
IComponentoperator= (const IComponent &arg)=delete
 The copy assignment operator is deleted. More...
 
virtual ~IComponent (void)=default
 The virtual default destructor.
 
virtual ApplicationGetApplication (void) const =0
 Gets the application instance of the actual process which loaded this component. More...
 
virtual ILibraryGetLibrary (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.
 

Detailed Description

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).

See also
IControllerComponent

Constructor & Destructor Documentation

◆ IComponent() [1/2]

Arp::Base::Acf::Commons::IComponent::IComponent ( IComponent &&  arg)
defaultnoexcept

The move constructor.

Parameters
argThe argument to move.

◆ IComponent() [2/2]

Arp::Base::Acf::Commons::IComponent::IComponent ( const IComponent arg)
delete

The copy constructor is deleted.

Parameters
argThe argument to copy.

Member Function Documentation

◆ Dispose()

virtual void Arp::Base::Acf::Commons::IComponent::Dispose ( void  )
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.

◆ GetApplication()

virtual Application & Arp::Base::Acf::Commons::IComponent::GetApplication ( void  ) const
pure virtual

Gets the application instance of the actual process which loaded this component.

Returns
The application instance of the actual process which loaded this component.

Implemented in Arp::Base::Acf::Commons::ComponentBase.

◆ GetComponentCategory()

virtual ComponentCategory Arp::Base::Acf::Commons::IComponent::GetComponentCategory ( void  ) const
pure virtual

Gets the ComponentCategory of this component.

Returns
The ComponentCategory of this component.

Implemented in Arp::Base::Acf::Commons::ComponentBase.

◆ GetComponentInfoItem()

virtual String Arp::Base::Acf::Commons::IComponent::GetComponentInfoItem ( ComponentInfoKind  kind) const
pure virtual

Gets additional information about the component

Parameters
kindKind of information to get
Returns
String of the requested information. Empty string if kind is not found.

Implemented in Arp::Base::Acf::Commons::ComponentBase.

◆ GetFullName()

virtual String Arp::Base::Acf::Commons::IComponent::GetFullName ( void  ) const
pure virtual

Gets the full qualified name of this component

Returns
The full qualified name of this component

Implemented in Arp::Base::Acf::Commons::ComponentBase.

◆ GetLibrary()

virtual ILibrary & Arp::Base::Acf::Commons::IComponent::GetLibrary ( void  ) const
pure virtual

Gets the library instance of this component.

Returns
The library instance of this component.

Implemented in Arp::Base::Acf::Commons::ComponentBase.

◆ GetStartOrder()

virtual uint32 Arp::Base::Acf::Commons::IComponent::GetStartOrder ( void  ) const
pure virtual

Gets the start order of this component.

Returns
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.

◆ Initialize()

virtual void Arp::Base::Acf::Commons::IComponent::Initialize ( void  )
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.

◆ IsRequired()

virtual bool Arp::Base::Acf::Commons::IComponent::IsRequired ( void  ) const
pure virtual

Determines if this component is required.

Returns
true if this component is a required, otherwise false.

Implemented in Arp::Base::Acf::Commons::ComponentBase.

◆ LoadConfig()

virtual void Arp::Base::Acf::Commons::IComponent::LoadConfig ( void  )
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.

◆ LoadSettings()

virtual void Arp::Base::Acf::Commons::IComponent::LoadSettings ( const String settingsPath)
pure virtual

Loads components firmware settings.

Parameters
settingsPathThe 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.

◆ operator=() [1/2]

IComponent & Arp::Base::Acf::Commons::IComponent::operator= ( const IComponent arg)
delete

The copy assignment operator is deleted.

Parameters
argThe argument to copy.
Returns
This instance.

◆ operator=() [2/2]

IComponent & Arp::Base::Acf::Commons::IComponent::operator= ( IComponent &&  arg)
defaultnoexcept

The move assignment operator.

Parameters
argThe argument to move.
Returns
This instance.

◆ PowerDown()

virtual void Arp::Base::Acf::Commons::IComponent::PowerDown ( void  )
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.

◆ PublishServices()

virtual void Arp::Base::Acf::Commons::IComponent::PublishServices ( void  )
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.

◆ ResetConfig()

virtual void Arp::Base::Acf::Commons::IComponent::ResetConfig ( void  )
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.

◆ SetupConfig()

virtual void Arp::Base::Acf::Commons::IComponent::SetupConfig ( void  )
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.

◆ SetupSettings()

virtual void Arp::Base::Acf::Commons::IComponent::SetupSettings ( void  )
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.

◆ SubscribeServices()

virtual void Arp::Base::Acf::Commons::IComponent::SubscribeServices ( void  )
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.


The documentation for this class was generated from the following file: