YARP
Yet Another Robot Platform
yarp::os::impl::FakeTwoWayStream Class Reference

A dummy two way stream for testing purposes. More...

#include <yarp/os/impl/FakeTwoWayStream.h>

+ Inheritance diagram for yarp::os::impl::FakeTwoWayStream:

Public Member Functions

 FakeTwoWayStream (StringInputStream *target=nullptr)
 
void setTarget (StringInputStream &target)
 
InputStreamgetInputStream () override
 Get an InputStream to read from. More...
 
virtual StringInputStreamgetStringInputStream ()
 
OutputStreamgetOutputStream () override
 Get an OutputStream to write to. More...
 
const ContactgetLocalAddress () const override
 Get the address of the local side of the stream. More...
 
const ContactgetRemoteAddress () const override
 Get the address of the remote side of the stream. More...
 
void close () override
 Terminate the stream. More...
 
virtual void apply (const Bytes &b)
 
void addInputText (const std::string &str)
 
std::string getOutputText () const
 
std::string getInputText () const
 
bool isOk () const override
 Check if the stream is ok or in an error state. More...
 
void reset () override
 Reset the stream. More...
 
void beginPacket () override
 Mark the beginning of a logical packet. More...
 
void endPacket () override
 Mark the end of a logical packet (see beginPacket). More...
 
- Public Member Functions inherited from yarp::os::TwoWayStream
virtual ~TwoWayStream ()
 Destructor. More...
 
virtual InputStreamgetInputStream ()=0
 Get an InputStream to read from. More...
 
virtual OutputStreamgetOutputStream ()=0
 Get an OutputStream to write to. More...
 
virtual const ContactgetLocalAddress () const =0
 Get the address of the local side of the stream. More...
 
virtual const ContactgetRemoteAddress () const =0
 Get the address of the remote side of the stream. More...
 
virtual bool isOk () const =0
 Check if the stream is ok or in an error state. More...
 
virtual void reset ()=0
 Reset the stream. More...
 
virtual void close ()=0
 Terminate the stream. More...
 
virtual void beginPacket ()=0
 Mark the beginning of a logical packet. More...
 
virtual void endPacket ()=0
 Mark the end of a logical packet (see beginPacket). More...
 

Detailed Description

A dummy two way stream for testing purposes.

Definition at line 19 of file FakeTwoWayStream.h.

Constructor & Destructor Documentation

◆ FakeTwoWayStream()

yarp::os::impl::FakeTwoWayStream::FakeTwoWayStream ( StringInputStream target = nullptr)
inline

Definition at line 23 of file FakeTwoWayStream.h.

Member Function Documentation

◆ addInputText()

void yarp::os::impl::FakeTwoWayStream::addInputText ( const std::string &  str)
inline

Definition at line 73 of file FakeTwoWayStream.h.

◆ apply()

virtual void yarp::os::impl::FakeTwoWayStream::apply ( const Bytes b)
inlinevirtual

Definition at line 66 of file FakeTwoWayStream.h.

◆ beginPacket()

void yarp::os::impl::FakeTwoWayStream::beginPacket ( )
inlineoverridevirtual

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 97 of file FakeTwoWayStream.h.

◆ close()

void yarp::os::impl::FakeTwoWayStream::close ( )
inlineoverridevirtual

Terminate the stream.

Implements yarp::os::TwoWayStream.

Definition at line 60 of file FakeTwoWayStream.h.

◆ endPacket()

void yarp::os::impl::FakeTwoWayStream::endPacket ( )
inlineoverridevirtual

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

Implements yarp::os::TwoWayStream.

Definition at line 101 of file FakeTwoWayStream.h.

◆ getInputStream()

InputStream & yarp::os::impl::FakeTwoWayStream::getInputStream ( )
inlineoverridevirtual

Get an InputStream to read from.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 35 of file FakeTwoWayStream.h.

◆ getInputText()

std::string yarp::os::impl::FakeTwoWayStream::getInputText ( ) const
inline

Definition at line 83 of file FakeTwoWayStream.h.

◆ getLocalAddress()

const Contact & yarp::os::impl::FakeTwoWayStream::getLocalAddress ( ) const
inlineoverridevirtual

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 50 of file FakeTwoWayStream.h.

◆ getOutputStream()

OutputStream & yarp::os::impl::FakeTwoWayStream::getOutputStream ( )
inlineoverridevirtual

Get an OutputStream to write to.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 45 of file FakeTwoWayStream.h.

◆ getOutputText()

std::string yarp::os::impl::FakeTwoWayStream::getOutputText ( ) const
inline

Definition at line 78 of file FakeTwoWayStream.h.

◆ getRemoteAddress()

const Contact & yarp::os::impl::FakeTwoWayStream::getRemoteAddress ( ) const
inlineoverridevirtual

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 55 of file FakeTwoWayStream.h.

◆ getStringInputStream()

virtual StringInputStream & yarp::os::impl::FakeTwoWayStream::getStringInputStream ( )
inlinevirtual

Definition at line 40 of file FakeTwoWayStream.h.

◆ isOk()

bool yarp::os::impl::FakeTwoWayStream::isOk ( ) const
inlineoverridevirtual

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

Returns
true iff the stream is ok

Implements yarp::os::TwoWayStream.

Definition at line 88 of file FakeTwoWayStream.h.

◆ reset()

void yarp::os::impl::FakeTwoWayStream::reset ( )
inlineoverridevirtual

Reset the stream.

Implements yarp::os::TwoWayStream.

Definition at line 93 of file FakeTwoWayStream.h.

◆ setTarget()

void yarp::os::impl::FakeTwoWayStream::setTarget ( StringInputStream target)
inline

Definition at line 30 of file FakeTwoWayStream.h.


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