PLCnext API Documentation 23.0.2.9
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Arp::System::Acf::ComponentBase Class Reference

Use this class as base class for all Acf components. More...

#include <ComponentBase.hpp>

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

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.
 
IApplicationGetApplication (void) const final
 Gets the applicatopn instance of the actual process which loaded this component. More...
 
ILibraryGetLibrary (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 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...
 

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...
 
- Protected Member Functions inherited from Arp::System::Acf::IComponent
 IComponent (void)=default
 The default constructor.
 
virtual ~IComponent (void)=default
 The default destructor.
 

Additional Inherited Members

- Public Types inherited from Arp::System::Acf::IComponent
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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ComponentBase()

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.

Parameters
applicationThe application instance of the current process.
libraryThe hosting library instance of the component.
fullNameThe full qualified name of the component.
categoryThe ComponentCategory of the component.
startOrderThe start order of the component, see GetStartOrder.
isSingletonDetermines if the component is a singleton, see IsSingleton.

Member Function Documentation

◆ Dispose()

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

◆ GetApplication()

IApplication & Arp::System::Acf::ComponentBase::GetApplication ( void  ) const
inlinefinalvirtual

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

Implements Arp::System::Acf::IComponent.

◆ GetComponentCategory()

ComponentCategory Arp::System::Acf::ComponentBase::GetComponentCategory ( void  ) const
inlinefinalvirtual

Gets the ComponentCategory of this component.

Returns
The ComponentCategory of this component.

Implements Arp::System::Acf::IComponent.

◆ GetFullName()

String Arp::System::Acf::ComponentBase::GetFullName ( void  ) const
inlinefinalvirtual

Gets the full qualified name of this component

Returns
The full qualified name of this component

Implements Arp::System::Acf::IComponent.

◆ GetLibrary()

ILibrary & Arp::System::Acf::ComponentBase::GetLibrary ( void  ) const
inlinefinalvirtual

Gets the library instance of this component.

Implements Arp::System::Acf::IComponent.

◆ GetStartOrder()

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

Returns
The start order of this component.

Implements Arp::System::Acf::IComponent.

◆ GetVersion()

Version Arp::System::Acf::ComponentBase::GetVersion ( void  ) const
inlinefinalvirtual

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.

Implements Arp::System::Acf::IComponent.

◆ Initialize()

void Arp::System::Acf::ComponentBase::Initialize ( void  )
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.

◆ IsRequired()

bool Arp::System::Acf::ComponentBase::IsRequired ( void  ) const
inlinefinalvirtual

Determines if this component is required.

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

Implements Arp::System::Acf::IComponent.

◆ IsSingleton()

bool Arp::System::Acf::ComponentBase::IsSingleton ( void  ) const
inlinefinalvirtual

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.

Implements Arp::System::Acf::IComponent.

◆ LoadConfig()

void Arp::System::Acf::ComponentBase::LoadConfig ( void  )
overridevirtual

Loads components project configuration.

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

Implements Arp::System::Acf::IComponent.

◆ LoadSettings()

void Arp::System::Acf::ComponentBase::LoadSettings ( const String settingsPath)
overridevirtual

Loads components firmware settings.

This operation is called after SubscribeServices during the firmware setup.

Implements Arp::System::Acf::IComponent.

◆ PowerDown()

void Arp::System::Acf::ComponentBase::PowerDown ( void  )
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.

◆ PublishComponentService()

template<class TService , class TServiceFactory >
void Arp::System::Acf::ComponentBase::PublishComponentService ( void  )
inlineprotected

Publishes a component service for this component instance.

FOR INTERNAL USE ONLY.

Template Parameters
TServiceThe service type to publish.
TServiceFactoryThe type of the service factory to publish.

◆ PublishServices()

void Arp::System::Acf::ComponentBase::PublishServices ( void  )
overridevirtual

Publishes components services.

This operation is called after SetupSettings during the project setup.

Implements Arp::System::Acf::IComponent.

◆ ResetConfig()

void Arp::System::Acf::ComponentBase::ResetConfig ( void  )
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.

◆ SetupConfig()

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

◆ SetupSettings()

void Arp::System::Acf::ComponentBase::SetupSettings ( void  )
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.

◆ SubscribeServices()

void Arp::System::Acf::ComponentBase::SubscribeServices ( void  )
overridevirtual

Subscribes services required by this component.

This operation is called after Initialize during the firmware setup.

Implements Arp::System::Acf::IComponent.


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