PLCnext API Documentation 23.0.2.9
RemotingReader.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
7#include "Arp/System/Rsc/Services/Rsc.h"
8
9// forwards
10namespace CommonRemoting
11{
12class BinaryReader2;
13}
14
15namespace Arp { namespace System { namespace Rsc { namespace Services
16{
17
18using namespace CommonRemoting;
19
20// forwards
21class RscReader;
22class RscClientContext;
23
28class RemotingReader
29{
30 friend class RscStream;
31
32public: // construction
33 RemotingReader(BinaryReader2& binaryReader, RscReader& rscReader, RscClientContext* pRscClientContext = nullptr);
34
35public: // getter
36 RscReader& GetRscReader(void);
37 bool HasDataTagging(void)const;
38
39public: // operations
40 size_t ReadArrayLength(void);
41 RscType ReadEnumeratorTag(bool& isEndTag);
42 void ReadDataInternal(byte* pBuffer, size_t count);
43 RscStringEncoding ReadStringEncoding(void);
44 void ReadStringInternal(char* pBuffer, size_t count, RscStringEncoding encoding, bool readTag = true);
45 RscType ReadObjectType(void);
46 size_t TryReadDataInternal(byte* pBuffer, size_t count);
47 void BeginReadStream(int& maxPackageSize, int& count, int& remaining);
48 bool ReadStream(byte* pBuffer, int bufferSize, int maxPackageSize, int& count, int& remaining);
49 DateTime ReadDateTime(void);
50 RscType ReadTag(void);
51 void ReadTag(RscType expectedType);
52 void ReadArrayTag(RscType elementType, size_t& arrayLength);
53 void ReadBeginStruct(size_t fieldCount);
54 size_t ReadFieldCount(void);
55 void ReadSecurityToken(SecurityToken& value, bool readTag = true);
56 RscArrayInformation ReadArrayInformation(void);
57
58private: // fields
59 BinaryReader2& binaryReader;
60 RscReader& rscReader;
61 RscClientContext* pRscClientContext = nullptr;
62};
63
65// inline methods of class RemotingReader
66inline RscReader& RemotingReader::GetRscReader(void)
67{
68 return this->rscReader;
69}
70
71
72
73}}}} // end of namespace Arp::System::Rsc::Services
@ System
System components used by the System, Device, Plc or Io domains.
RscStringEncoding
Determines the encoding of a Rsc String. Values are identical to CommonRemoting::StringEncoding.
Definition: RscStringEncoding.hpp:18
RscType
Data types supported by RSC.
Definition: RscType.hpp:36
Root namespace for the PLCnext API