YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::os::impl::NameserTwoWayStream Class Reference

Communicating between two ports via a variant plain-text protocol originally designed for the yarp name server. More...

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

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

Public Member Functions

 NameserTwoWayStream (TwoWayStream *delegate)
 
virtual ~NameserTwoWayStream ()
 
InputStreamgetInputStream () override
 Get an InputStream to read from.
 
OutputStreamgetOutputStream () override
 Get an OutputStream to write to.
 
const ContactgetLocalAddress () const override
 Get the address of the local side of the stream.
 
const ContactgetRemoteAddress () const override
 Get the address of the remote side of the stream.
 
bool isOk () const override
 Check if the stream is ok or in an error state.
 
void reset () override
 Reset the stream.
 
void close () override
 Terminate the stream.
 
void beginPacket () override
 Mark the beginning of a logical packet.
 
void endPacket () override
 Mark the end of a logical packet (see beginPacket).
 
yarp::conf::ssize_t read (yarp::os::Bytes &b) override
 Read a block of data from the stream.
 
- Public Member Functions inherited from yarp::os::TwoWayStream
virtual ~TwoWayStream ()
 Destructor.
 

Detailed Description

Communicating between two ports via a variant plain-text protocol originally designed for the yarp name server.

For backwards compatibility

Definition at line 21 of file NameserCarrier.h.

Constructor & Destructor Documentation

◆ NameserTwoWayStream()

yarp::os::impl::NameserTwoWayStream::NameserTwoWayStream ( TwoWayStream delegate)

Definition at line 18 of file NameserCarrier.cpp.

◆ ~NameserTwoWayStream()

yarp::os::impl::NameserTwoWayStream::~NameserTwoWayStream ( )
virtual

Definition at line 25 of file NameserCarrier.cpp.

Member Function Documentation

◆ beginPacket()

void yarp::os::impl::NameserTwoWayStream::beginPacket ( )
overridevirtual

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 68 of file NameserCarrier.cpp.

◆ close()

void yarp::os::impl::NameserTwoWayStream::close ( )
overridevirtual

Terminate the stream.

Implements yarp::os::TwoWayStream.

Definition at line 63 of file NameserCarrier.cpp.

◆ endPacket()

void yarp::os::impl::NameserTwoWayStream::endPacket ( )
overridevirtual

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

Implements yarp::os::TwoWayStream.

Definition at line 73 of file NameserCarrier.cpp.

◆ getInputStream()

yarp::os::InputStream & yarp::os::impl::NameserTwoWayStream::getInputStream ( )
overridevirtual

Get an InputStream to read from.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 33 of file NameserCarrier.cpp.

◆ getLocalAddress()

const Contact & yarp::os::impl::NameserTwoWayStream::getLocalAddress ( ) const
overridevirtual

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 43 of file NameserCarrier.cpp.

◆ getOutputStream()

yarp::os::OutputStream & yarp::os::impl::NameserTwoWayStream::getOutputStream ( )
overridevirtual

Get an OutputStream to write to.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 38 of file NameserCarrier.cpp.

◆ getRemoteAddress()

const Contact & yarp::os::impl::NameserTwoWayStream::getRemoteAddress ( ) const
overridevirtual

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 48 of file NameserCarrier.cpp.

◆ isOk()

bool yarp::os::impl::NameserTwoWayStream::isOk ( ) const
overridevirtual

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 53 of file NameserCarrier.cpp.

◆ read()

yarp::conf::ssize_t yarp::os::impl::NameserTwoWayStream::read ( yarp::os::Bytes b)
overridevirtual

Read a block of data from the stream.

Should block and wait for data.

Parameters
b[out]the block of data to read to
Returns
the number of bytes read, or -1 upon error

Implements yarp::os::InputStream.

Definition at line 78 of file NameserCarrier.cpp.

◆ reset()

void yarp::os::impl::NameserTwoWayStream::reset ( )
overridevirtual

Reset the stream.

Implements yarp::os::TwoWayStream.

Definition at line 58 of file NameserCarrier.cpp.


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