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