YARP
Yet Another Robot Platform
yarp::os::NullConnection Class Reference

#include <yarp/os/NullConnection.h>

+ Inheritance diagram for yarp::os::NullConnection:

Public Member Functions

bool isValid () const override
 Check if this object is really a connection, or just an empty placeholder. More...
 
bool isTextMode () const override
 Check if carrier is textual in nature. More...
 
bool canEscape () const override
 Check if carrier can encode administrative messages, as opposed to just user data. More...
 
void handleEnvelope (const std::string &envelope) override
 Carriers that do not distinguish data from administrative headers (i.e. More...
 
bool requireAck () const override
 Check if carrier has flow control, requiring sent messages to be acknowledged by recipient. More...
 
bool supportReply () const override
 This flag is used by YARP to determine whether the connection can carry RPC traffic, that is, messages with replies. More...
 
bool isLocal () const override
 Check if carrier operates within a single process. More...
 
bool isPush () const override
 Check if carrier is "push" or "pull" style. More...
 
bool isConnectionless () const override
 Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp). More...
 
bool isBroadcast () const override
 Check if this carrier uses a broadcast mechanism. More...
 
bool isActive () const override
 Check if carrier is alive and error free. More...
 
bool modifiesIncomingData () const override
 Check if this carrier modifies incoming data through the Carrier::modifyIncomingData method. More...
 
yarp::os::ConnectionReadermodifyIncomingData (yarp::os::ConnectionReader &reader) override
 Modify incoming payload data, if appropriate. More...
 
bool acceptIncomingData (yarp::os::ConnectionReader &reader) override
 Determine whether incoming data should be accepted. More...
 
bool modifiesOutgoingData () const override
 Check if this carrier modifies outgoing data through the Carrier::modifyOutgoingData method. More...
 
const PortWritermodifyOutgoingData (const PortWriter &writer) override
 Modify outgoing payload data, if appropriate. More...
 
bool acceptOutgoingData (const PortWriter &writer) override
 Determine whether outgoing data should be accepted. More...
 
bool modifiesReply () const override
 Check if this carrier modifies outgoing data through the Carrier::modifyReply method. More...
 
PortReadermodifyReply (PortReader &reader) override
 Modify reply payload data, if appropriate. More...
 
void setCarrierParams (const yarp::os::Property &params) override
 Configure carrier from port administrative commands. More...
 
void getCarrierParams (yarp::os::Property &params) const override
 Get carrier configuration and deliver it by port administrative commands. More...
 
void getHeader (yarp::os::Bytes &header) const override
 Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to select it. More...
 
void prepareDisconnect () override
 Do cleanup and preparation for the coming disconnect, if necessary. More...
 
std::string getName () const override
 Get the name of this connection type ("tcp", "mcast", "shmem", ...) More...
 
- Public Member Functions inherited from yarp::os::Connection
virtual ~Connection ()
 Destructor. More...
 
virtual bool isBareMode () const
 Check if carrier excludes type information from payload. More...
 

Detailed Description

Definition at line 19 of file NullConnection.h.

Member Function Documentation

◆ acceptIncomingData()

bool NullConnection::acceptIncomingData ( yarp::os::ConnectionReader reader)
overridevirtual

Determine whether incoming data should be accepted.

Parameters
readerfor incoming data.
Returns
true if data should be accepted, false if it should be discarded.

Implements yarp::os::Connection.

Definition at line 75 of file NullConnection.cpp.

◆ acceptOutgoingData()

bool NullConnection::acceptOutgoingData ( const PortWriter writer)
overridevirtual

Determine whether outgoing data should be accepted.

Parameters
writerfor outgoing data.
Returns
true if data should be accepted, false if it should be discarded.

Implements yarp::os::Connection.

Definition at line 91 of file NullConnection.cpp.

◆ canEscape()

bool NullConnection::canEscape ( ) const
overridevirtual

Check if carrier can encode administrative messages, as opposed to just user data.

The word escape is used in the sense of escape character or escape sequence here.

Returns
true if carrier can encode administrative messages

Implements yarp::os::Connection.

Definition at line 28 of file NullConnection.cpp.

◆ getCarrierParams()

void NullConnection::getCarrierParams ( yarp::os::Property params) const
overridevirtual

Get carrier configuration and deliver it by port administrative commands.

Parameters
paramsoutput carrier properties

Implements yarp::os::Connection.

Definition at line 112 of file NullConnection.cpp.

◆ getHeader()

void NullConnection::getHeader ( yarp::os::Bytes header) const
overridevirtual

Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to select it.

Parameters
[out]headera buffer to hold the first 8 bytes to send on a connection

Implements yarp::os::Connection.

Definition at line 117 of file NullConnection.cpp.

◆ getName()

std::string NullConnection::getName ( ) const
overridevirtual

Get the name of this connection type ("tcp", "mcast", "shmem", ...)

Returns
the name of this connection type

Implements yarp::os::Connection.

Definition at line 128 of file NullConnection.cpp.

◆ handleEnvelope()

void NullConnection::handleEnvelope ( const std::string &  envelope)
overridevirtual

Carriers that do not distinguish data from administrative headers (i.e.

canEscape returns false), can overload this method to handle the envelope inside the stream. On the receiving side, the InputStream will have to overload the yarp::os::InputStream::setReadEnvelopeCallback method, and execute the callback as soon as the envelope is ready.

Parameters
envelopethe envelope to transmit bundled with data.

Implements yarp::os::Connection.

Definition at line 32 of file NullConnection.cpp.

◆ isActive()

bool NullConnection::isActive ( ) const
overridevirtual

Check if carrier is alive and error free.

Returns
true if carrier is active.

Implements yarp::os::Connection.

Definition at line 60 of file NullConnection.cpp.

◆ isBroadcast()

bool NullConnection::isBroadcast ( ) const
overridevirtual

Check if this carrier uses a broadcast mechanism.

This flag is used to determine whether it is appropriate to send "kill" messages using a carrier or whether they should be sent "out-of-band"

Returns
true if carrier uses a broadcast mechanism.

Implements yarp::os::Connection.

Definition at line 56 of file NullConnection.cpp.

◆ isConnectionless()

bool NullConnection::isConnectionless ( ) const
overridevirtual

Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).

This flag is used by YARP to determine whether the connection can carry RPC traffic, that is, messages with replies. Replies are not supported by YARP on connectionless carriers.

Returns
true if carrier is connectionless

Implements yarp::os::Connection.

Definition at line 52 of file NullConnection.cpp.

◆ isLocal()

bool NullConnection::isLocal ( ) const
overridevirtual

Check if carrier operates within a single process.

In such a case, YARP connections may get completely reorganized in order to optimize them.

Returns
true if carrier will only operate within a single process

Implements yarp::os::Connection.

Definition at line 44 of file NullConnection.cpp.

◆ isPush()

bool NullConnection::isPush ( ) const
overridevirtual

Check if carrier is "push" or "pull" style.

Push means that the side that initiates a connection is also the one that will sending of data or commands. All native YARP connections are like this. A "pull" style is equivalent to automatically sending a "reverse connection" port command at the start of the connection.

Returns
true if carrier is "push" style, false if "pull" style

Implements yarp::os::Connection.

Definition at line 48 of file NullConnection.cpp.

◆ isTextMode()

bool NullConnection::isTextMode ( ) const
overridevirtual

Check if carrier is textual in nature.

Returns
true if carrier is text-based

Implements yarp::os::Connection.

Definition at line 24 of file NullConnection.cpp.

◆ isValid()

bool NullConnection::isValid ( ) const
overridevirtual

Check if this object is really a connection, or just an empty placeholder.

Returns
true if a valid connection

Reimplemented from yarp::os::Connection.

Definition at line 20 of file NullConnection.cpp.

◆ modifiesIncomingData()

bool NullConnection::modifiesIncomingData ( ) const
overridevirtual

Check if this carrier modifies incoming data through the Carrier::modifyIncomingData method.

Returns
true if carrier wants Carrier::modifyIncomingData called.

Implements yarp::os::Connection.

Definition at line 65 of file NullConnection.cpp.

◆ modifiesOutgoingData()

bool NullConnection::modifiesOutgoingData ( ) const
overridevirtual

Check if this carrier modifies outgoing data through the Carrier::modifyOutgoingData method.

Returns
true if carrier wants Carrier::modifyOutgoingData called.

Implements yarp::os::Connection.

Definition at line 81 of file NullConnection.cpp.

◆ modifiesReply()

bool NullConnection::modifiesReply ( ) const
overridevirtual

Check if this carrier modifies outgoing data through the Carrier::modifyReply method.

Returns
true if carrier wants Carrier::modifyReply called.

Implements yarp::os::Connection.

Definition at line 97 of file NullConnection.cpp.

◆ modifyIncomingData()

yarp::os::ConnectionReader & NullConnection::modifyIncomingData ( yarp::os::ConnectionReader reader)
overridevirtual

Modify incoming payload data, if appropriate.

Doesn't need to be done immediately, it is fine to hold onto a reference to the incoming data reader and use it on demand. This can be handy in order to avoid unnecessary copies.

Parameters
readerfor incoming data.
Returns
reader for modified version of incoming data.

Implements yarp::os::Connection.

Definition at line 70 of file NullConnection.cpp.

◆ modifyOutgoingData()

const PortWriter & NullConnection::modifyOutgoingData ( const PortWriter writer)
overridevirtual

Modify outgoing payload data, if appropriate.

Doesn't need to be done immediately, it is fine to hold onto a reference to the outgoing data reader and use it on demand. This can be handy in order to avoid unnecessary copies.

Parameters
writerfor outgoing data.
Returns
writer for modified version of outgoing data.

Implements yarp::os::Connection.

Definition at line 86 of file NullConnection.cpp.

◆ modifyReply()

PortReader & NullConnection::modifyReply ( PortReader reader)
overridevirtual

Modify reply payload data, if appropriate.

Parameters
readerfor the replied message.
Returns
reader for modified version of the replied message.

Implements yarp::os::Connection.

Definition at line 102 of file NullConnection.cpp.

◆ prepareDisconnect()

void NullConnection::prepareDisconnect ( )
overridevirtual

Do cleanup and preparation for the coming disconnect, if necessary.

Implements yarp::os::Connection.

Definition at line 124 of file NullConnection.cpp.

◆ requireAck()

bool NullConnection::requireAck ( ) const
overridevirtual

Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.

Returns
true if carrier requires acknowledgement.

Implements yarp::os::Connection.

Definition at line 36 of file NullConnection.cpp.

◆ setCarrierParams()

void NullConnection::setCarrierParams ( const yarp::os::Property params)
overridevirtual

Configure carrier from port administrative commands.

Parameters
paramscarrier properties

Implements yarp::os::Connection.

Definition at line 107 of file NullConnection.cpp.

◆ supportReply()

bool NullConnection::supportReply ( ) const
overridevirtual

This flag is used by YARP to determine whether the connection can carry RPC traffic, that is, messages with replies.

Returns
true if carrier supports replies

Implements yarp::os::Connection.

Definition at line 40 of file NullConnection.cpp.


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