YARP
Yet Another Robot Platform
yarp::os::InputProtocol Class Referenceabstract

The input side of an active connection between two ports. More...

#include <yarp/os/InputProtocol.h>

+ Inheritance diagram for yarp::os::InputProtocol:

Public Member Functions

virtual ~InputProtocol ()=default
 Destructor. More...
 
virtual bool open (const std::string &name)=0
 Start negotiating a carrier, using the given name as our own if a name is needed (this should generally match the name of the associated port). More...
 
virtual void close ()=0
 Negotiate an end to operations. More...
 
virtual void interrupt ()=0
 Try to get operations interrupted. More...
 
virtual const RoutegetRoute () const =0
 Get the route associated with this connection. More...
 
virtual ConnectionReaderbeginRead ()=0
 Begin a read operation, with bytes read via the returned yarp::os::ConnectionReader object. More...
 
virtual void endRead ()=0
 End the current read operation, begin by beginRead(). More...
 
virtual void reply (SizedWriter &writer)=0
 Reply to a message we have just read. More...
 
virtual ConnectiongetConnection ()=0
 Get the basic connection through which we are communicating. More...
 
virtual ConnectiongetReceiver ()=0
 It is possible to chain a basic connection with a modifier. More...
 
virtual bool isOk () const =0
 Check if the connection is valid and can be used. More...
 
virtual OutputProtocolgetOutput ()=0
 Get an interface for doing write operations on the connection. More...
 
virtual void suppressReply ()=0
 Make sure that any attempt to send a reply to input will be denied. More...
 
virtual OutputStreamgetOutputStream ()=0
 Access the output stream associated with the connection. More...
 
virtual InputStreamgetInputStream ()=0
 Access the input stream associated with the connection. More...
 
virtual void setEnvelope (const std::string &str)=0
 Set the envelope that will be attached to the next message. More...
 
virtual bool setTimeout (double timeout)=0
 Set the timeout to be used for network operations. More...
 
virtual void attachPort (Contactable *port)=0
 Set the port to be associated with the connection. More...
 
virtual bool isReplying () const =0
 

Detailed Description

The input side of an active connection between two ports.

Definition at line 37 of file InputProtocol.h.

Constructor & Destructor Documentation

◆ ~InputProtocol()

virtual yarp::os::InputProtocol::~InputProtocol ( )
virtualdefault

Destructor.

Member Function Documentation

◆ attachPort()

virtual void yarp::os::InputProtocol::attachPort ( Contactable port)
pure virtual

Set the port to be associated with the connection.

Implemented in yarp::os::impl::Protocol.

◆ beginRead()

virtual ConnectionReader& yarp::os::InputProtocol::beginRead ( )
pure virtual

Begin a read operation, with bytes read via the returned yarp::os::ConnectionReader object.

Be sure to call endRead() when done.

Implemented in yarp::os::impl::Protocol.

◆ close()

virtual void yarp::os::InputProtocol::close ( )
pure virtual

Negotiate an end to operations.

Implemented in yarp::os::impl::Protocol.

◆ endRead()

virtual void yarp::os::InputProtocol::endRead ( )
pure virtual

End the current read operation, begin by beginRead().

Implemented in yarp::os::impl::Protocol.

◆ getConnection()

virtual Connection& yarp::os::InputProtocol::getConnection ( )
pure virtual

Get the basic connection through which we are communicating.

Implemented in yarp::os::impl::Protocol.

◆ getInputStream()

virtual InputStream& yarp::os::InputProtocol::getInputStream ( )
pure virtual

Access the input stream associated with the connection.

Implemented in yarp::os::impl::Protocol.

◆ getOutput()

virtual OutputProtocol& yarp::os::InputProtocol::getOutput ( )
pure virtual

Get an interface for doing write operations on the connection.

Not all types of connections will support this, check yarp::os::OutputProtocol::isOk() on the result.

Implemented in yarp::os::impl::Protocol.

◆ getOutputStream()

virtual OutputStream& yarp::os::InputProtocol::getOutputStream ( )
pure virtual

Access the output stream associated with the connection.

Implemented in yarp::os::impl::Protocol.

◆ getReceiver()

virtual Connection& yarp::os::InputProtocol::getReceiver ( )
pure virtual

It is possible to chain a basic connection with a modifier.

If there is a modifier, this call returns it, otherwise it will return a connection for which yarp::os::Connection::isValid() returns false.

Implemented in yarp::os::impl::Protocol.

◆ getRoute()

virtual const Route& yarp::os::InputProtocol::getRoute ( ) const
pure virtual

Get the route associated with this connection.

A route is a triplet of the source port, destination port, and carrier.

Implemented in yarp::os::impl::Protocol.

◆ interrupt()

virtual void yarp::os::InputProtocol::interrupt ( )
pure virtual

Try to get operations interrupted.

Implemented in yarp::os::impl::Protocol.

◆ isOk()

virtual bool yarp::os::InputProtocol::isOk ( ) const
pure virtual

Check if the connection is valid and can be used.

Implemented in yarp::os::impl::Protocol.

◆ isReplying()

virtual bool yarp::os::InputProtocol::isReplying ( ) const
pure virtual
Returns
true if a reply will be made to a message.

Implemented in yarp::os::impl::Protocol.

◆ open()

virtual bool yarp::os::InputProtocol::open ( const std::string &  name)
pure virtual

Start negotiating a carrier, using the given name as our own if a name is needed (this should generally match the name of the associated port).

Implemented in yarp::os::impl::Protocol.

◆ reply()

virtual void yarp::os::InputProtocol::reply ( SizedWriter writer)
pure virtual

Reply to a message we have just read.

Implemented in yarp::os::impl::Protocol.

◆ setEnvelope()

virtual void yarp::os::InputProtocol::setEnvelope ( const std::string &  str)
pure virtual

Set the envelope that will be attached to the next message.

Implemented in yarp::os::impl::Protocol.

◆ setTimeout()

virtual bool yarp::os::InputProtocol::setTimeout ( double  timeout)
pure virtual

Set the timeout to be used for network operations.

Implemented in yarp::os::impl::Protocol.

◆ suppressReply()

virtual void yarp::os::InputProtocol::suppressReply ( )
pure virtual

Make sure that any attempt to send a reply to input will be denied.

This is a good thing to do if we know the sender is not expecting a reply.

Implemented in yarp::os::impl::Protocol.


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