PLCnext API Documentation 23.6.0.37
RscStreamAdapter.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
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
14namespace Arp { namespace System { namespace Rsc { namespace Services
15{
16
20{
21public: // usings
23
24public: // construction/destruction/assignment
26 RscStreamAdapter(void) = default;
28 RscStreamAdapter(const RscStream& rscStream);
30 RscStreamAdapter(Stream& stream);
31
32public: // setter/getter
33 RscStream& GetRscStream(void);
34
35public: // 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
44private: // 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:27
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:21
Writes data to Rsc.
Definition: RscWriter.hpp:32
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API