8#include "Arp/System/Rsc/Services/Rsc.h"
9#include "Arp/System/Rsc/Services/RemotingReader.hpp"
10#include "Arp/System/Rsc/Services/RemotingWriter.hpp"
11#include "Arp/System/Commons/Io/Stream.hpp"
13namespace Arp {
namespace System {
namespace Rsc {
namespace Services
82 size_t Read(
byte* pBuffer,
size_t bufferSize);
110 void Write(
const byte* pBuffer,
size_t bufferCount);
128 RemotingWriter* pWriter =
nullptr;
129 RemotingReader* pReader =
nullptr;
130 bool initialized =
false;
135 static constexpr int MaxPacketSize = std::numeric_limits<int>::max();
136 static constexpr size_t BufferSize = 4096;
153 return this->pWriter !=
nullptr;
158 return this->pReader !=
nullptr;
163 this->pWriter = value;
168 this->pReader = value;
Provides a generic view of a sequence of bytes.
Definition: Stream.hpp:20
Enables Rsc services to marshal large data packets as stream.
Definition: RscStream.hpp:21
void Flush(void)
Ends the read writer operation and writes remaining internal buffered bytes
void Skip(void)
Skips the entire stream and disposes the read data
bool HasWriter(void) const
Determines if this instance is able to write.
Definition: RscStream.hpp:151
void SerializeFrom(RscStream stream)
Serialize the stream data from the as agument passed stream
~RscStream(void)=default
Destructs this instance and frees all resources.
RscStream(void)=default
Constructs an instance of RscStream
size_t Read(byte *pBuffer, size_t bufferSize)
Reads up to bufferSize byte into memory referenced by pBuffer
void DeserializeTo(Stream &stream)
Deserialize the stream data and copies it to the as agument passed stream
void SetWriter(RemotingWriter *pValue)
Sets RemotingWriter needed to write stream data
Definition: RscStream.hpp:161
RscStream(const RscStream &rscStream)=default
Copy Constructor
bool HasReader(void) const
Determines if this instance is able to reade.
Definition: RscStream.hpp:156
void Write(const byte *pBuffer, size_t bufferCount)
Writes data into stream
void BeginRead(void)
Begins the read operation. Need pReader to be set.
void BeginWrite(void)
Begins the write operation
void SerializeFrom(Stream &stream)
Serialize the stream data from the as agument passed stream
void SetReader(RemotingReader *pValue)
Sets RemotingReader needed to read stream data
Definition: RscStream.hpp:166
void DeserializeTo(RscStream stream)
Deserialize the stream data and copies it to the as agument passed Rsc stream
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API