PLCnext API Documentation 23.0.2.9
RscComponentServiceFactoryBase.hxx
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Rsc/Services/IRscServiceFactory.hpp"
9
10// forwards
11namespace Arp { namespace System { namespace Acf
12{
13class IComponent;
14}}}
15
16namespace Arp { namespace System { namespace Rsc { namespace Services
17{
18
19using namespace Arp::System::Acf;
20
25template<class TDerived>
26class RscComponentServiceFactoryBase : public IRscServiceFactory
27{
28protected: // typedefs
29 typedef RscComponentServiceFactoryBase<TDerived> Base;
30
31protected: // construction/destruction
33 RscComponentServiceFactoryBase(IComponent& component);
35 virtual ~RscComponentServiceFactoryBase(void) = default;
36
37public: // abstract properties
38 bool IsSecure(void)const override;
39 const String& GetServiceProviderName(void)const override;
40
41public: // static operations
42 static IRscServiceFactory* Create(IComponent& component);
43
44protected: // fields
45 IComponent& component;
46};
47
49// inline methods of class RscComponentServiceFactoryBase
50template<class TDerived>
51inline RscComponentServiceFactoryBase<TDerived>::RscComponentServiceFactoryBase(IComponent& componentArg)
52 : component(componentArg)
53{
54}
55
56template<class TDerived>
57inline bool RscComponentServiceFactoryBase<TDerived>::IsSecure()const
58{
59 return false;
60}
61
62template<class TDerived>
63inline const String& RscComponentServiceFactoryBase<TDerived>::GetServiceProviderName()const
64{
65 return String::Empty;
66}
67
68template<class TDerived>
69inline IRscServiceFactory* RscComponentServiceFactoryBase<TDerived>::Create(IComponent& component)
70{
71 return new TDerived(component);
72}
73
74}}}} // end of namespace Arp::System::Rsc::Services
This is the most important basic interface of the Arp platform. Any component shall implement this in...
Definition: IComponent.hpp:81
This is the namespace of the Application Component Framework.
Definition: ComponentBase.hpp:13
@ System
System components used by the System, Device, Plc or Io domains.
@ Create
Creates a new file. If the file already exists, it is overwritten.
Root namespace for the PLCnext API