PLCnext API Documentation 23.0.2.9
|
Use this class as base class for all Acf components. More...
#include <ComponentBase.hpp>
Public Member Functions | |
ComponentBase (IApplication &application, ILibrary &library, const String &fullName, ComponentCategory category, uint32 startOrder=GetDefaultStartOrder(), bool isSingleton=false) | |
Constructs an <see cref = "IComponentFactory" / > instance. More... | |
~ComponentBase (void) override=default | |
The default destructor. | |
IApplication & | GetApplication (void) const final |
Gets the applicatopn instance of the actual process which loaded this component. More... | |
ILibrary & | GetLibrary (void) const final |
Gets the library instance of this component. More... | |
String | GetFullName (void) const final |
Gets the full qualified name of this component More... | |
Version | GetVersion (void) const final |
Gets the version of this component which defaults to the build version of the related library. More... | |
ComponentCategory | GetComponentCategory (void) const final |
Gets the ComponentCategory of this component. More... | |
uint32 | GetStartOrder (void) const final |
Gets the start order of this component. More... | |
bool | IsSingleton (void) const final |
Determines if this component is a singleton, that is, it's instantiated only once on the entire system. More... | |
bool | IsRequired (void) const final |
Determines if this component is required. More... | |
void | Initialize (void) override |
Initializes this component: creates singletons, makes any registrations, creates any resources not depending on settings or configuration. More... | |
void | LoadSettings (const String &settingsPath) override |
Loads components firmware settings. More... | |
void | SetupSettings (void) override |
Sets up components settings which were loaded in LoadSettings. More... | |
void | SubscribeServices (void) override |
Subscribes services required by this component. More... | |
void | PublishServices (void) override |
Publishes components services. More... | |
void | LoadConfig (void) override |
Loads components project configuration. More... | |
void | SetupConfig (void) override |
Sets up components configuration which was loaded in LoadConfig. More... | |
void | ResetConfig (void) override |
Resets components project configuration. More... | |
void | Dispose (void) override |
Disposes component. More... | |
void | PowerDown (void) override |
This operation is called on a power breakdown event and executes component specific actions when power get lost. More... | |
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... | |
Static Public Member Functions | |
static uint32 | GetDefaultStartOrder (void) |
Protected Member Functions | |
template<class TService , class TServiceFactory > | |
void | PublishComponentService (void) |
Publishes a component service for this component instance. More... | |
![]() | |
IComponent (void)=default | |
The default constructor. | |
virtual | ~IComponent (void)=default |
The default destructor. | |
Additional Inherited Members | |
![]() | |
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. | |
Use this class as base class for all Acf components.
This class implements some basic component functionality aud implements all operations of the IComponent interface with an emtpy implementation.
Arp::System::Acf::ComponentBase::ComponentBase | ( | IApplication & | application, |
ILibrary & | library, | ||
const String & | fullName, | ||
ComponentCategory | category, | ||
uint32 | startOrder = GetDefaultStartOrder() , |
||
bool | isSingleton = false |
||
) |
Constructs an <see cref = "IComponentFactory" / > instance.
application | The application instance of the current process. |
library | The hosting library instance of the component. |
fullName | The full qualified name of the component. |
category | The ComponentCategory of the component. |
startOrder | The start order of the component, see GetStartOrder. |
isSingleton | Determines if the component is a singleton, see IsSingleton. |
|
overridevirtual |
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.
Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
Gets the applicatopn instance of the actual process which loaded this component.
Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
Gets the ComponentCategory of this component.
Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
Gets the full qualified name of this component
Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
Gets the library instance of this component.
Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
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.
Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
Gets the version of this component which defaults to the build version of the related library.
Implements Arp::System::Acf::IComponent.
|
overridevirtual |
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.
Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
Determines if this component is required.
true
if this component is a required, otherwise false
.Implements Arp::System::Acf::IComponent.
|
inlinefinalvirtual |
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
.Implements Arp::System::Acf::IComponent.
|
overridevirtual |
Loads components project configuration.
This operation is called after PublishServices and first during the project setup.
Implements Arp::System::Acf::IComponent.
|
overridevirtual |
Loads components firmware settings.
This operation is called after SubscribeServices during the firmware setup.
Implements Arp::System::Acf::IComponent.
|
overridevirtual |
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.
Implements Arp::System::Acf::IComponent.
|
inlineprotected |
Publishes a component service for this component instance.
FOR INTERNAL USE ONLY.
TService | The service type to publish. |
TServiceFactory | The type of the service factory to publish. |
|
overridevirtual |
Publishes components services.
This operation is called after SetupSettings during the project setup.
Implements Arp::System::Acf::IComponent.
|
overridevirtual |
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.
Implements Arp::System::Acf::IComponent.
|
overridevirtual |
Sets up components configuration which was loaded in LoadConfig.
This operation is called after LoadConfig during the project setup.
Implements Arp::System::Acf::IComponent.
|
overridevirtual |
Sets up components settings which were loaded in LoadSettings.
This operation is called after LoadSettings during the firmware setup.
Implements Arp::System::Acf::IComponent.
|
overridevirtual |
Subscribes services required by this component.
This operation is called after Initialize during the firmware setup.
Implements Arp::System::Acf::IComponent.