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