PLCnext API Documentation  21.9.0.40
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/Rsc/Services/RscReader.hpp"
10 #include "Arp/System/Rsc/Services/RscWriter.hpp"
11 
12 namespace Arp { namespace System { namespace Rsc { namespace Services
13 {
14 
18 {
19 public: // usings
21 
22 public: // construction/destruction/assignment
24  RscStreamAdapter(Stream* pStream = nullptr);
26  RscStreamAdapter(Stream& stream);
27 
28 public: // operations
29  void SerializeTo(RscWriter& writer)const;
30  void DeserializeFrom(RscReader& reader)const;
31  void CopyTo(Stream& other)const;
32  void CopyFrom(Stream& other)const;
33 
34 private: // fields
35  Stream* pStream = nullptr;
36 };
37 
39 // inline methods of class RscStreamAdapter
41  : pStream(pStream)
42 {
43 }
44 
46  : pStream(&stream)
47 {
48 }
49 
50 }}}} // end of namespace Arp::System::Rsc::Services
Reads data from Rsc
Definition: RscReader.hpp:23
Writes data to Rsc.
Definition: RscWriter.hpp:32
This class serves as adapter between Rsc streams and streams from Arp::System::Commons::Io, e.g. file streams.
Definition: RscStreamAdapter.hpp:17
Provides a generic view of a sequence of bytes.
Definition: Stream.hpp:19
Root namespace for the PLCnext API
RscStreamAdapter(Stream *pStream=nullptr)
Constructs an RscStreamAdapter instance from a <cref name="Stream">.
Definition: RscStreamAdapter.hpp:40
System components used by the System, Device, Plc or Io domains.