PLCnext API Documentation 23.6.0.37
Public Types | Public Member Functions | Protected Member Functions | List of all members
Arp::System::Acf::IComponent Class Referenceabstract

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>

Inheritance diagram for Arp::System::Acf::IComponent:
Inheritance graph

Public Types

typedef std::shared_ptr< IComponentPtr
 The pointer type of this interface.
 
typedef std::map< String, IComponent::PtrDictionary
 A map of components where the key is the name of the component.
 

Public Member Functions

virtual IApplicationGetApplication (void) const =0
 Gets the applicatopn 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 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.
 

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

See also
IControllerComponent

Member Function Documentation

◆ Dispose()

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

◆ GetApplication()

virtual IApplication & Arp::System::Acf::IComponent::GetApplication ( void  ) const
pure virtual

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

Implemented in Arp::System::Acf::ComponentBase.

◆ GetComponentCategory()

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

Gets the ComponentCategory of this component.

Returns
The ComponentCategory of this component.

Implemented in Arp::System::Acf::ComponentBase.

◆ GetFullName()

virtual String Arp::System::Acf::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::System::Acf::ComponentBase.

◆ GetLibrary()

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

Gets the library instance of this component.

Implemented in Arp::System::Acf::ComponentBase.

◆ GetStartOrder()

virtual uint32 Arp::System::Acf::IComponent::GetStartOrder ( void  ) const
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.

Returns
The start order of this component.

Implemented in Arp::System::Acf::ComponentBase.

◆ GetVersion()

virtual Version Arp::System::Acf::IComponent::GetVersion ( void  ) const
pure virtual

Gets the version of this component which defaults to the build version of the related library.

See also
ILibrary::GetBuildVersion
Returns
The version of this component.

Implemented in Arp::System::Acf::ComponentBase.

◆ Initialize()

virtual void Arp::System::Acf::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::System::Acf::ComponentBase.

◆ IsRequired()

virtual bool Arp::System::Acf::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::System::Acf::ComponentBase.

◆ IsSingleton()

virtual bool Arp::System::Acf::IComponent::IsSingleton ( void  ) const
pure virtual

Determines if this component is a singleton, that is, it's instantiated only once on the entire system.

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

Implemented in Arp::System::Acf::ComponentBase.

◆ LoadConfig()

virtual void Arp::System::Acf::IComponent::LoadConfig ( void  )
pure virtual

Loads components project configuration.

This operation is called after PublishServices and first during the project setup.

Implemented in Arp::System::Acf::ComponentBase.

◆ LoadSettings()

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

Loads components firmware settings.

This operation is called after SubscribeServices during the firmware setup.

Implemented in Arp::System::Acf::ComponentBase.

◆ PowerDown()

virtual void Arp::System::Acf::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 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.

◆ PublishServices()

virtual void Arp::System::Acf::IComponent::PublishServices ( void  )
pure virtual

Publishes components services.

This operation is called after SetupSettings during the project setup.

Implemented in Arp::System::Acf::ComponentBase.

◆ ResetConfig()

virtual void Arp::System::Acf::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 (asymmetrical) to SetupConfig and LoadConfig.

Implemented in Arp::System::Acf::ComponentBase.

◆ SetupConfig()

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

◆ SetupSettings()

virtual void Arp::System::Acf::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::System::Acf::ComponentBase.

◆ SubscribeServices()

virtual void Arp::System::Acf::IComponent::SubscribeServices ( void  )
pure virtual

Subscribes services required by this component.

This operation is called after Initialize during the firmware setup.

Implemented in Arp::System::Acf::ComponentBase.


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