7 #include "Arp/System/Rsc/Services/Rsc.h"
8 #include "Arp/System/Rsc/Services/RemotingReader.hpp"
9 #include "Arp/System/Rsc/Services/RemotingWriter.hpp"
10 #include "Arp/System/Commons/Io/Stream.hpp"
12 namespace Arp {
namespace System {
namespace Rsc {
namespace Services
81 size_t Read(
byte* pBuffer,
size_t bufferSize);
109 void Write(
const byte* pBuffer,
size_t bufferCount);
127 RemotingWriter* pWriter =
nullptr;
128 RemotingReader* pReader =
nullptr;
129 bool initialized =
false;
134 static constexpr
int MaxPacketSize = std::numeric_limits<int>::max();
135 static constexpr
size_t BufferSize = 4096;
152 return this->pWriter !=
nullptr;
157 return this->pReader !=
nullptr;
162 this->pWriter = value;
167 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:20
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:150
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:160
RscStream(const RscStream &rscStream)=default
Copy Constructor
bool HasReader(void) const
Determines if this instance is able to reade.
Definition: RscStream.hpp:155
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:165
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