PLCnext API Documentation  22.9.0.33
RscStreamAdapter.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Commons/Io/Stream.hpp"
9 #include "Arp/System/Commons/Io/NullStream.hpp"
10 #include "Arp/System/Rsc/Services/RscStream.hpp"
11 #include "Arp/System/Rsc/Services/RscReader.hpp"
12 #include "Arp/System/Rsc/Services/RscWriter.hpp"
13 
14 namespace Arp { namespace System { namespace Rsc { namespace Services
15 {
16 
20 {
21 public: // usings
23 
24 public: // construction/destruction/assignment
26  RscStreamAdapter(void) = default;
28  RscStreamAdapter(const RscStream& rscStream);
30  RscStreamAdapter(Stream& stream);
31 
32 public: // setter/getter
33  RscStream& GetRscStream(void);
34 
35 public: // operations
36  void Serialize(void);
37  void Deserialize(void);
38  void SerializeTo(RscWriter& writer)const;
39  void DeserializeFrom(RscReader& reader);
40  void ReadFrom(Stream& other);
41  void WriteTo(Stream& other);
42  void Skip(void);
43 
44 private: // fields
45  Stream* pStream = nullptr;
46  RscStream rscStream;
47 };
48 
50 // inline methods of class RscStreamAdapter
52  : rscStream(rscStream)
53 {
54 }
55 
57  : pStream(&stream)
58 {
59 }
60 
61 }}}} // end of namespace Arp::System::Rsc::Services
Provides a generic view of a sequence of bytes.
Definition: Stream.hpp:20
Reads data from Rsc
Definition: RscReader.hpp:26
This class serves as adapter between Rsc streams and streams from Arp::System::Commons::Io,...
Definition: RscStreamAdapter.hpp:20
RscStreamAdapter(void)=default
Constructs an uninitialized RscStreamAdapter instance.
Enables Rsc services to marshal large data packets as stream.
Definition: RscStream.hpp:20
Writes data to Rsc.
Definition: RscWriter.hpp:31
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API