PLCnext API Documentation 24.0.0.71
RscServiceStubBase.hxx
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Rsc/Services/Rsc.h"
9#include "Arp/System/Rsc/Services/IRscServiceStub.hpp"
10#include "Arp/System/Rsc/Services/RscServerContext.hpp"
11
12namespace Arp { namespace System { namespace Rsc { namespace Services
13{
14
19template<class TServiceImpl>
20class RscServiceStubBase : public IRscServiceStub
21{
22protected: // usings
23 using ServiceImpl = TServiceImpl;
24 using Base = RscServiceStubBase<TServiceImpl>;
25
26protected: // construction/destruction
28 RscServiceStubBase(ServiceImpl* pServiceImpl);
30 virtual ~RscServiceStubBase(void);
31
32public: // abstract IServiceStub operations
33 virtual void Invoke(int methodHandle, RscServerContext& context) = 0;
34
35private: // deleted methods (for non-copyable classes)
36 RscServiceStubBase(const RscServiceStubBase& arg) = delete;
37 RscServiceStubBase& operator=(const RscServiceStubBase& arg) = delete;
38
39protected: // fields
40 ServiceImpl* pServiceImpl;
41};
42
44// inline methods of class RscServiceStubBase
45template<class TServiceImpl>
46inline RscServiceStubBase<TServiceImpl>::RscServiceStubBase(ServiceImpl* pImpl)
47 : pServiceImpl(pImpl)
48{
49}
50
51template<class TServiceImpl>
52inline RscServiceStubBase<TServiceImpl>::~RscServiceStubBase(void)
53{
54 if (this->pServiceImpl != NULL)
55 {
56 delete this->pServiceImpl;
57 this->pServiceImpl = NULL;
58 }
59}
60
61}}}} // 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