6#ifndef YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H
7#define YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H
15#include "XmlRpcClient.h"
16#include "XmlRpcServerConnection.h"
24 TwoWayStream *delegate;
25 YarpXmlRpc::XmlRpcClient client;
26 YarpXmlRpc::XmlRpcServerConnection server;
33 XmlRpcStream(TwoWayStream *delegate,
bool sender,
bool interpretRos) :
37 interpretRos(interpretRos)
39 this->delegate = delegate;
47 if (delegate !=
nullptr) {
66 return delegate->getLocalAddress();
71 return delegate->getRemoteAddress();
76 return delegate->isOk();
91 delegate->beginPacket();
96 delegate->endPacket();
107 delegate->getInputStream().interrupt();
const yarp::os::Contact & getLocalAddress() const override
Get the address of the local side of the stream.
yarp::os::OutputStream & getOutputStream() override
Get an OutputStream to write to.
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.
XmlRpcStream(TwoWayStream *delegate, bool sender, bool interpretRos)
void reset() override
Reset the stream.
const yarp::os::Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
void close() override
Terminate the stream.
yarp::os::InputStream & getInputStream() override
Get an InputStream to read from.
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.