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

The basic state of a connection - route, streams in use, etc. More...

#include <yarp/os/ConnectionState.h>

+ Inheritance diagram for yarp::os::ConnectionState:

Public Member Functions

virtual ~ConnectionState ()
 Destructor. More...
 
virtual const RoutegetRoute () const =0
 Get the route associated with this connection. More...
 
virtual void setRoute (const Route &route)=0
 Set the route associated with this connection. More...
 
virtual OutputStreamgetOutputStream ()=0
 Access the output stream associated with this connection. More...
 
virtual InputStreamgetInputStream ()=0
 Access the input stream associated with this connection. More...
 
virtual ConnectiongetConnection ()=0
 Access the controller for this connection. More...
 
virtual void setRemainingLength (int len)=0
 Tell the connection that the given number of bytes are left to be read. More...
 
virtual std::string getSenderSpecifier () const =0
 Extract a name for the sender, if the connection type supports that. More...
 
virtual TwoWayStreamgetStreams ()=0
 Access the streams associated with the connection. More...
 
virtual void takeStreams (TwoWayStream *streams)=0
 Provide streams to be used with the connection. More...
 
virtual TwoWayStreamgiveStreams ()=0
 Take ownership of the streams associated with the connection. More...
 
virtual void setReference (yarp::os::Portable *ref)=0
 Give a direct pointer to an object being sent on the connection. More...
 
virtual bool checkStreams () const =0
 Check whether streams are in a good state. More...
 
virtual ContactablegetContactable () const =0
 Get the port associated with the connection. More...
 
OutputStreamos ()
 Shorthand for getOutputStream() More...
 
InputStreamis ()
 Shorthand for getInputStream() More...
 
virtual const std::string & getEnvelope () const =0
 Read the envelope associated with the current message. More...
 

Detailed Description

The basic state of a connection - route, streams in use, etc.

Definition at line 30 of file ConnectionState.h.

Constructor & Destructor Documentation

◆ ~ConnectionState()

yarp::os::ConnectionState::~ConnectionState ( )
virtualdefault

Destructor.

Member Function Documentation

◆ checkStreams()

virtual bool yarp::os::ConnectionState::checkStreams ( ) const
pure virtual

Check whether streams are in a good state.

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

◆ getConnection()

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

Access the controller for this connection.

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

◆ getContactable()

virtual Contactable* yarp::os::ConnectionState::getContactable ( ) const
pure virtual

Get the port associated with the connection.

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

◆ getEnvelope()

virtual const std::string& yarp::os::ConnectionState::getEnvelope ( ) const
pure virtual

Read the envelope associated with the current message.

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

◆ getInputStream()

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

Access the input stream associated with this connection.

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

◆ getOutputStream()

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

Access the output stream associated with this connection.

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

◆ getRoute()

virtual const Route& yarp::os::ConnectionState::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.

◆ getSenderSpecifier()

virtual std::string yarp::os::ConnectionState::getSenderSpecifier ( ) const
pure virtual

Extract a name for the sender, if the connection type supports that.

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

◆ getStreams()

virtual TwoWayStream& yarp::os::ConnectionState::getStreams ( )
pure virtual

Access the streams associated with the connection.

The connection remains the owner of those streams.

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

◆ giveStreams()

virtual TwoWayStream* yarp::os::ConnectionState::giveStreams ( )
pure virtual

Take ownership of the streams associated with the connection.

The connection will never touch them again after this call.

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

◆ is()

InputStream& yarp::os::ConnectionState::is ( )
inline

Shorthand for getInputStream()

Definition at line 125 of file ConnectionState.h.

◆ os()

OutputStream& yarp::os::ConnectionState::os ( )
inline

Shorthand for getOutputStream()

Definition at line 117 of file ConnectionState.h.

◆ setReference()

virtual void yarp::os::ConnectionState::setReference ( yarp::os::Portable ref)
pure virtual

Give a direct pointer to an object being sent on the connection.

This allows serialization to be bypassed for local connections.

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

◆ setRemainingLength()

virtual void yarp::os::ConnectionState::setRemainingLength ( int  len)
pure virtual

Tell the connection that the given number of bytes are left to be read.

This is useful when there is no low-level way to know this.

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

◆ setRoute()

virtual void yarp::os::ConnectionState::setRoute ( const Route route)
pure virtual

Set the route associated with this connection.

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

◆ takeStreams()

virtual void yarp::os::ConnectionState::takeStreams ( TwoWayStream streams)
pure virtual

Provide streams to be used with the connection.

The connection becomes the owner of these streams. Any streams already in use are closed and destroyed.

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


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