7#ifndef ARP_USE_ARP_SYSTEM_ACF_COMMONS
8#include "Arp/Base/Acf/Commons/ComponentBase.hpp"
15#include "Arp/System/Acf/ILibrary.hpp"
16#include "Arp/System/Acf/IComponent.hpp"
17#include "Arp/Base/Rsc/Commons/Services/IRscServiceFactory.hpp"
19namespace Arp {
namespace System {
namespace Acf
22using namespace Arp::Base::Rsc::Commons;
40 IApplication& application,
43 ComponentCategory category,
45 bool isSingleton =
false);
57 bool IsSingleton(
void)
const final;
80 template<
class TService,
class TServiceFactory>
81 void PublishComponentService(
void);
84 void PublishComponentService(
const char* serviceName,
IRscServiceFactory* pServiceFactory);
91 IApplication& application;
94 ComponentCategory componentCategory = ComponentCategory::None;
96 bool isSingleton =
false;
97 bool isRequired =
false;
100 static const uint32 maxComponentStartOrder;
101 static const uint32 customComponentStartOrderShift;
109 return this->application;
114 return this->library;
119 return this->fullName;
122inline ArpVersion ComponentBase::GetVersion(
void)
const
129 return this->componentCategory;
134 return this->startOrder;
137inline bool ComponentBase::IsSingleton()
const
139 return this->isSingleton;
144 return this->isRequired;
147template<
class TService,
class TServiceFactory>
148inline void ComponentBase::PublishComponentService()
150 this->PublishComponentService(TService::GetProxyFactory().GetServiceName(), TServiceFactory::Create(*
this));
Use this class as base class of all Acf components.
Definition: ComponentBase.hpp:20
ILibrary & GetLibrary(void) const final
Gets the library instance of this component.
Definition: ComponentBase.cpp:70
~ComponentBase(void) override
The default destructor.
static uint32 GetDefaultStartOrder(void)
Gets the default start order of a component which is DomainsStartOrder::Custom.
Definition: ComponentBase.cpp:58
void Initialize(void) override
Initializes this component: creates singletons, makes any registrations, creates any resources not de...
Definition: ComponentBase.cpp:106
void SubscribeServices(void) override
Subscribes services required by this component.
Definition: ComponentBase.cpp:124
uint32 GetStartOrder(void) const final
Gets the start order of this component.
Definition: ComponentBase.cpp:88
void PublishServices(void) override
Publishes components services.
Definition: ComponentBase.cpp:130
void LoadSettings(const String &settingsPath) override
Loads components firmware settings.
Definition: ComponentBase.cpp:112
bool IsRequired(void) const override
Determines if this component is required.
Definition: ComponentBase.cpp:94
void LoadConfig(void) override
Loads components project configuration.
Definition: ComponentBase.cpp:136
void PowerDown(void) override
This operation is called on a power breakdown event and executes component specific actions when powe...
Definition: ComponentBase.cpp:160
void Dispose(void) override
Disposes this component.
Definition: ComponentBase.cpp:154
ComponentCategory GetComponentCategory(void) const final
Gets the ComponentCategory of this component.
Definition: ComponentBase.cpp:82
void SetupSettings(void) override
Sets up components settings which were loaded in LoadSettings.
Definition: ComponentBase.cpp:118
Application & GetApplication(void) const final
Gets the application instance of the actual process which loaded this component.
Definition: ComponentBase.cpp:64
ComponentBase(ILibrary &library, const String &fullName, ComponentCategory category, uint32 startOrder)
Constructs an ComponentBase instance.
Definition: ComponentBase.cpp:51
String GetFullName(void) const final
Gets the full qualified name of this component
Definition: ComponentBase.cpp:76
void SetupConfig(void) override
Sets up components configuration which was loaded in LoadConfig.
Definition: ComponentBase.cpp:142
void ResetConfig(void) override
Resets components project configuration.
Definition: ComponentBase.cpp:148
This is the most important basic interface of the Arp platform. Any component shall implement this in...
Definition: IComponent.hpp:79
Any Acf Library shall implement this interface.
Definition: ILibrary.hpp:20
This class compounds Arp build version and infos.
Definition: ArpVersion.hpp:21
const Version & GetBuildVersion(void) const
Gets the versions of this ArpVersion.
Definition: ArpVersion.cpp:141
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
Interface for service factory classes to create instances of the service implementation,...
Definition: IRscServiceFactory.hpp:26
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:33
This is the namespace of the Application Component Framework.
Definition: ComponentBase.hpp:72
Root namespace for the PLCnext API