PLCnext API Documentation 25.0.2.69
Public Member Functions | List of all members
Arp::Base::Rsc::Commons::RscStream Class Reference

This class might be used to marshal unstructured stream data as bytes. More...

#include <RscStream.hpp>

Public Member Functions

 RscStream (void)
 Constructs an empty RscStream instance.
 
 RscStream (Stream &stream)
 Constructs an RscStream for reading or writing data from or to a Stream. More...
 
 RscStream (const RscStreamReader &rscStreamReader)
 Constructs a RscStream instance for deserializing data. More...
 
 RscStream (const RscStreamWriter &rscStreamWriter)
 Constructs a RscStream instance for serializing data. More...
 
RscStreamReader GetRscStreamReader (void)
 Gets the stream reader to deserialize data from RSC. More...
 
RscStreamWriter GetRscStreamWriter (void)
 Gets the stream writer to serialize data to RSC. More...
 
void Serialize (void)
 Reads the stream data from the supplied Stream and serialize it to RSC.
 
void Deserialize (void)
 Deserializes the stream data from RSC and writes it to the supplied Stream.
 
void SerializeTo (RscWriter &writer)
 Reads the stream data from the supplied Stream while serializing it to RSC. It the Stream was not supplied, the data is read from RSC. More...
 
void SerializeTo (RscStreamWriter &writer)
 Reads the stream data from the supplied Stream while serializing it to RSC. It the Stream was not supplied, the data is read from RSC. More...
 
void DeserializeFrom (RscReader &reader)
 Writes the stream data to the supplied Stream while deserializing it from RSC. It the Stream was not supplied, the data is written to RSC. More...
 
void DeserializeFrom (RscStreamReader &reader)
 Writes the stream data to the supplied Stream while deserializing it from RSC. It the Stream was not supplied, the data is written to RSC. More...
 
void ReadFrom (Stream &stream)
 Reads the stream data from the given Stream while serializing it to RSC or another stream. If another Stream was supplied by construction, the data is read from it. More...
 
void WriteTo (Stream &stream)
 Writes the stream data to the given Stream while deserializing it from RSC or another stream. If another Stream was supplied by construction, the data is written to it. More...
 
void Skip (void)
 Skips any remaining remoting data during deserialization, if any error occurs.
 

Detailed Description

This class might be used to marshal unstructured stream data as bytes.

This class serves as adapter between RSC streams and streams from Arp::Base::Commons::Io, e.g. file streams.

Constructor & Destructor Documentation

◆ RscStream() [1/3]

Arp::Base::Rsc::Commons::RscStream::RscStream ( Stream stream)

Constructs an RscStream for reading or writing data from or to a Stream.

Parameters
streamThe stream to adapt.

◆ RscStream() [2/3]

Arp::Base::Rsc::Commons::RscStream::RscStream ( const RscStreamReader rscStreamReader)

Constructs a RscStream instance for deserializing data.

Parameters
rscStreamReaderThe stream reader to read the data from.

◆ RscStream() [3/3]

Arp::Base::Rsc::Commons::RscStream::RscStream ( const RscStreamWriter rscStreamWriter)

Constructs a RscStream instance for serializing data.

Parameters
rscStreamWriterThe stream writer to write the data to.

Member Function Documentation

◆ DeserializeFrom() [1/2]

void Arp::Base::Rsc::Commons::RscStream::DeserializeFrom ( RscReader reader)

Writes the stream data to the supplied Stream while deserializing it from RSC. It the Stream was not supplied, the data is written to RSC.

Parameters
readerThe RSC reader to deserialize the stream data from.

◆ DeserializeFrom() [2/2]

void Arp::Base::Rsc::Commons::RscStream::DeserializeFrom ( RscStreamReader reader)

Writes the stream data to the supplied Stream while deserializing it from RSC. It the Stream was not supplied, the data is written to RSC.

Parameters
readerThe RSC stream reader to deserialize the stream data from.

◆ GetRscStreamReader()

RscStreamReader Arp::Base::Rsc::Commons::RscStream::GetRscStreamReader ( void  )

Gets the stream reader to deserialize data from RSC.

Returns
The stream reader.
Exceptions
InvalidOperationExceptionIf this instance was not constructed with a RscStreamReader.

◆ GetRscStreamWriter()

RscStreamWriter Arp::Base::Rsc::Commons::RscStream::GetRscStreamWriter ( void  )

Gets the stream writer to serialize data to RSC.

Returns
The stream writer.
Exceptions
InvalidOperationExceptionIf this instance was not constructed with a RscStreamWriter.

◆ ReadFrom()

void Arp::Base::Rsc::Commons::RscStream::ReadFrom ( Stream stream)

Reads the stream data from the given Stream while serializing it to RSC or another stream. If another Stream was supplied by construction, the data is read from it.

Parameters
streamThe stream to read the data from.

◆ SerializeTo() [1/2]

void Arp::Base::Rsc::Commons::RscStream::SerializeTo ( RscStreamWriter writer)

Reads the stream data from the supplied Stream while serializing it to RSC. It the Stream was not supplied, the data is read from RSC.

Parameters
writerThe RSC stream writer to serialize the stream data to.

◆ SerializeTo() [2/2]

void Arp::Base::Rsc::Commons::RscStream::SerializeTo ( RscWriter writer)

Reads the stream data from the supplied Stream while serializing it to RSC. It the Stream was not supplied, the data is read from RSC.

Parameters
writerThe RSC writer to serialize the stream data to.

◆ WriteTo()

void Arp::Base::Rsc::Commons::RscStream::WriteTo ( Stream stream)

Writes the stream data to the given Stream while deserializing it from RSC or another stream. If another Stream was supplied by construction, the data is written to it.

Parameters
streamThe stream to write the data to.

The documentation for this class was generated from the following files: