9 #ifndef YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H
10 #define YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H
18 #include "XmlRpcClient.h"
19 #include "XmlRpcServerConnection.h"
27 TwoWayStream *delegate;
28 YarpXmlRpc::XmlRpcClient client;
29 YarpXmlRpc::XmlRpcServerConnection server;
36 XmlRpcStream(TwoWayStream *delegate,
bool sender,
bool interpretRos) :
40 interpretRos(interpretRos)
42 this->delegate = delegate;
50 if (delegate !=
nullptr) {
69 return delegate->getLocalAddress();
74 return delegate->getRemoteAddress();
79 return delegate->isOk();
94 delegate->beginPacket();
99 delegate->endPacket();
110 delegate->getInputStream().interrupt();
void beginPacket() override
Mark the beginning of a logical packet.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
bool isOk() const override
Check if the stream is ok or in an error state.
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
void interrupt() override
Interrupt the stream.
const yarp::os::Contact & getLocalAddress() const override
Get the address of the local side of the stream.
XmlRpcStream(TwoWayStream *delegate, bool sender, bool interpretRos)
yarp::os::InputStream & getInputStream() override
Get an InputStream to read from.
void reset() override
Reset the stream.
yarp::os::OutputStream & getOutputStream() override
Get an OutputStream to write to.
void close() override
Terminate the stream.
const yarp::os::Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
A simple abstraction for a block of bytes.
Simple specification of the minimum functions needed from output streams.
virtual void write(char ch)
Write a single byte to the stream.
An OutputStream that produces a string.
A stream which can be asked to perform bidirectional communication.