PLCnext API Documentation 25.0.2.69
RscClientContext.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/delegate.hxx"
9#include "Arp/Base/Rsc/Commons/Rsc.hpp"
10#include "Arp/Base/Rsc/Commons/Services/IRscServiceProxy.hpp"
11#include "Arp/Base/Rsc/Commons/Services/RscClient.TransactionGuard.hpp" // do not remove, this is used in all proxies
12
13namespace Arp::Base::Rsc::Commons::Services
14{
15
20class ARP_EXPORT RscClientContext
21{
22public: // usings
25
26public: // construction
27 RscClientContext(IRscServiceProxy& serviceProxy, RscHandle methodHandle, const char* methodName);
28
29 // canonical construction/destruction/assignment
30 RscClientContext(const RscClientContext& arg) = delete;
31 RscClientContext(RscClientContext&& arg)noexcept = delete;
32 RscClientContext& operator=(const RscClientContext&) = delete;
33 RscClientContext& operator=(RscClientContext&&)noexcept = delete;
34 ~RscClientContext(void);
35
36public: // getter
37 RscReader& GetReader(void);
38 RscWriter& GetWriter(void);
39
40public: // operations
41 void SendRequest(WriteDelegate writeFunction);
42 void ReceiveResponse(ReadDelegate readFunction);
43
44private: // methods
45 IRscServiceProxy& GetServiceProxy(void);
46
47private: // fields
48 IRscServiceProxy& serviceProxy;
49 RscHandle methodHandle = 0;
50 const char* methodName = nullptr;
51 SecurityToken cachedSecurityToken;
52};
53
54} // end of namespace Arp::Base::Rsc::Commons::Services
This class is used for authorization of arbitrary operations.
Definition: SecurityToken.hpp:18
Prototyping of delegate template.
Definition: delegate.hxx:14
Interface of RSC service proxies used on client side to invoke a service remotely.
Definition: IRscServiceProxy.hpp:20
RSC wrapper class of Remoting client context.
Definition: RscClientContext.hpp:21
Reads marshaled data of RSC services.
Definition: RscReader.hpp:34
Writes marshalled data of RSC services.
Definition: RscWriter.hpp:34