PLCnext API Documentation 24.0.0.71
RscServiceSecurityStubBase.hxx
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Rsc/Services/IRscAuthorizator.hpp"
9#include "Arp/System/Rsc/Services/RscServiceAuthorizator.hpp"
10
11namespace Arp { namespace System { namespace Rsc { namespace Services
12{
13
15template<class TServiceImpl>
16class RscServiceSecurityStubBase : public TServiceImpl
17{
18public: // typedefs
19 using Base = RscServiceSecurityStubBase<TServiceImpl>;
20 using ServiceImpl = TServiceImpl;
21
22public: // construction/destruction
24 RscServiceSecurityStubBase(const char* providerName, IRscAuthorizator* pAuthorizator);
26 RscServiceSecurityStubBase(const RscServiceSecurityStubBase& arg) = delete;
28 RscServiceSecurityStubBase& operator=(const RscServiceSecurityStubBase& arg) = delete;
30 ~RscServiceSecurityStubBase(void) = default;
31
32protected: // operations
33 void AuthorizeServiceInvocation(const char* methodName);
34
35private: // fields
36 RscServiceAuthorizator authorizator;
37};
38
40// inline methods of class RscServiceSecurityStubBase
41
42template<class TServiceImpl>
43inline RscServiceSecurityStubBase<TServiceImpl>::RscServiceSecurityStubBase(const char* providerName, IRscAuthorizator* pAuthorizator)
44 : authorizator(providerName, TServiceImpl::GetProxyFactory().GetServiceName(), pAuthorizator)
45{
46}
47
48template<class TServiceImpl>
49inline void Services::RscServiceSecurityStubBase<TServiceImpl>::AuthorizeServiceInvocation(const char* methodName)
50{
51 this->authorizator.AuthorizeServiceInvocation(methodName);
52}
53
54}}}} // end of namespace Arp::System::Rsc::Services
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API