YARP  2.3.68+272-20170522.1+git50f0ae7
Yet Another Robot Platform
yarp::os::XmlRpcStream Class Reference

#include <xmlrpc_carrier/XmlRpcStream.h>

+ Inheritance diagram for yarp::os::XmlRpcStream:

Public Member Functions

 XmlRpcStream (TwoWayStream *delegate, bool sender, bool interpretRos)
 
virtual ~XmlRpcStream ()
 
virtual yarp::os::InputStreamgetInputStream ()
 Get an InputStream to read from. More...
 
virtual yarp::os::OutputStreamgetOutputStream ()
 Get an OutputStream to write to. More...
 
virtual const yarp::os::ContactgetLocalAddress ()
 Get the address of the local side of the stream. More...
 
virtual const yarp::os::ContactgetRemoteAddress ()
 Get the address of the remote side of the stream. More...
 
virtual bool isOk ()
 Check if the stream is ok or in an error state. More...
 
virtual void reset ()
 Reset the stream. More...
 
virtual void close ()
 Terminate the stream. More...
 
virtual void beginPacket ()
 Mark the beginning of a logical packet. More...
 
virtual void endPacket ()
 Mark the end of a logical packet (see beginPacket). More...
 
virtual void write (const Bytes &b)
 Write a block of bytes to the stream. More...
 
virtual YARP_SSIZE_T read (const Bytes &b)
 Read a block of data from the stream. More...
 
virtual void interrupt ()
 Interrupt the stream. More...
 
- Public Member Functions inherited from yarp::os::TwoWayStream
virtual ~TwoWayStream ()
 Destructor. More...
 
- Public Member Functions inherited from yarp::os::InputStream
 InputStream ()
 Constructor. More...
 
virtual ~InputStream ()
 Destructor. More...
 
virtual void check ()
 Perform maintenance actions, if needed. More...
 
virtual int read ()
 Read and return a single byte. More...
 
virtual YARP_SSIZE_T read (const Bytes &b, size_t offset, YARP_SSIZE_T len)
 Read a block of data from the stream. More...
 
virtual YARP_SSIZE_T partialRead (const yarp::os::Bytes &b)
 Like read, but solicit partial responses. More...
 
virtual bool setReadTimeout (double timeout)
 Set activity timeout. More...
 
ConstString readLine (int terminal='\n', bool *success=YARP_NULLPTR)
 Read a block of text terminated with a specific marker (or EOF). More...
 
YARP_SSIZE_T readFull (const Bytes &b)
 Keep reading until buffer is full. More...
 
YARP_SSIZE_T readDiscard (size_t len)
 Read and discard a fixed number of bytes. More...
 
virtual bool setReadEnvelopeCallback (readEnvelopeCallbackType callback, void *data)
 Install a callback that the InputStream will have to call when the envelope is read from a message in carriers that cannot be escaped. More...
 
- Public Member Functions inherited from yarp::os::OutputStream
virtual ~OutputStream ()
 Destructor. More...
 
virtual void write (char ch)
 Write a single byte to the stream. More...
 
virtual void write (const Bytes &b, int offset, int len)
 Write a block of bytes to the stream. More...
 
virtual void flush ()
 Make sure all pending write operations are finished. More...
 
virtual void writeLine (const char *data, int len)
 Write some text followed by a line feed. More...
 
virtual bool setWriteTimeout (double timeout)
 Set activity timeout. More...
 
virtual bool setTypeOfService (int tos)
 
virtual int getTypeOfService ()
 

Private Attributes

TwoWayStreamdelegate
 
YarpXmlRpc::XmlRpcClient client
 
YarpXmlRpc::XmlRpcServerConnection server
 
StringInputStream sis
 
StringOutputStream sos
 
bool sender
 
bool firstRound
 
bool interpretRos
 

Additional Inherited Members

- Public Types inherited from yarp::os::InputStream
typedef void(* readEnvelopeCallbackType) (void *, const yarp::os::Bytes &envelope)
 Callback type for setting the envelope from a message in carriers that cannot be escaped. More...
 

Detailed Description

Definition at line 26 of file XmlRpcStream.h.

Constructor & Destructor Documentation

◆ XmlRpcStream()

yarp::os::XmlRpcStream::XmlRpcStream ( TwoWayStream delegate,
bool  sender,
bool  interpretRos 
)
inline

Definition at line 40 of file XmlRpcStream.h.

◆ ~XmlRpcStream()

virtual yarp::os::XmlRpcStream::~XmlRpcStream ( )
inlinevirtual

Definition at line 52 of file XmlRpcStream.h.

Member Function Documentation

◆ beginPacket()

virtual void yarp::os::XmlRpcStream::beginPacket ( )
inlinevirtual

Mark the beginning of a logical packet.

This is a unit that should be treated in an atomic fashion by YARP. If any part is corrupted, the whole should be dropped.

Implements yarp::os::TwoWayStream.

Definition at line 96 of file XmlRpcStream.h.

◆ close()

virtual void yarp::os::XmlRpcStream::close ( )
inlinevirtual

Terminate the stream.

Implements yarp::os::InputStream.

Definition at line 91 of file XmlRpcStream.h.

◆ endPacket()

virtual void yarp::os::XmlRpcStream::endPacket ( )
inlinevirtual

Mark the end of a logical packet (see beginPacket).

Implements yarp::os::TwoWayStream.

Definition at line 101 of file XmlRpcStream.h.

◆ getInputStream()

virtual yarp::os::InputStream& yarp::os::XmlRpcStream::getInputStream ( )
inlinevirtual

Get an InputStream to read from.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 60 of file XmlRpcStream.h.

◆ getLocalAddress()

virtual const yarp::os::Contact& yarp::os::XmlRpcStream::getLocalAddress ( )
inlinevirtual

Get the address of the local side of the stream.

Returns
the address of the local side of the stream. The address will be tagged as invalid if the stream is not set up.

Implements yarp::os::TwoWayStream.

Definition at line 71 of file XmlRpcStream.h.

◆ getOutputStream()

virtual yarp::os::OutputStream& yarp::os::XmlRpcStream::getOutputStream ( )
inlinevirtual

Get an OutputStream to write to.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 65 of file XmlRpcStream.h.

◆ getRemoteAddress()

virtual const yarp::os::Contact& yarp::os::XmlRpcStream::getRemoteAddress ( )
inlinevirtual

Get the address of the remote side of the stream.

Returns
the address of the remote side of the stream. The address will be tagged as invalid if the stream is not set up.

Implements yarp::os::TwoWayStream.

Definition at line 76 of file XmlRpcStream.h.

◆ interrupt()

virtual void yarp::os::XmlRpcStream::interrupt ( )
inlinevirtual

Interrupt the stream.

If the stream is currently in a blocked state, it must be unblocked.

Reimplemented from yarp::os::InputStream.

Definition at line 112 of file XmlRpcStream.h.

◆ isOk()

virtual bool yarp::os::XmlRpcStream::isOk ( )
inlinevirtual

Check if the stream is ok or in an error state.

Returns
true iff the stream is ok

Implements yarp::os::InputStream.

Definition at line 81 of file XmlRpcStream.h.

◆ read()

YARP_SSIZE_T XmlRpcStream::read ( const Bytes b)
virtual

Read a block of data from the stream.

Should block and wait for data.

Parameters
bthe block of data to read to
Returns
the number of bytes read, or -1 upon error

Implements yarp::os::InputStream.

Definition at line 89 of file XmlRpcStream.cpp.

◆ reset()

virtual void yarp::os::XmlRpcStream::reset ( )
inlinevirtual

Reset the stream.

Implements yarp::os::TwoWayStream.

Definition at line 86 of file XmlRpcStream.h.

◆ write()

void XmlRpcStream::write ( const Bytes b)
virtual

Write a block of bytes to the stream.

Parameters
bthe bytes to write

Implements yarp::os::OutputStream.

Definition at line 174 of file XmlRpcStream.cpp.

Member Data Documentation

◆ client

YarpXmlRpc::XmlRpcClient yarp::os::XmlRpcStream::client
private

Definition at line 32 of file XmlRpcStream.h.

◆ delegate

TwoWayStream* yarp::os::XmlRpcStream::delegate
private

Definition at line 31 of file XmlRpcStream.h.

◆ firstRound

bool yarp::os::XmlRpcStream::firstRound
private

Definition at line 37 of file XmlRpcStream.h.

◆ interpretRos

bool yarp::os::XmlRpcStream::interpretRos
private

Definition at line 38 of file XmlRpcStream.h.

◆ sender

bool yarp::os::XmlRpcStream::sender
private

Definition at line 36 of file XmlRpcStream.h.

◆ server

YarpXmlRpc::XmlRpcServerConnection yarp::os::XmlRpcStream::server
private

Definition at line 33 of file XmlRpcStream.h.

◆ sis

StringInputStream yarp::os::XmlRpcStream::sis
private

Definition at line 34 of file XmlRpcStream.h.

◆ sos

StringOutputStream yarp::os::XmlRpcStream::sos
private

Definition at line 35 of file XmlRpcStream.h.


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