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

The initial point-of-contact with a port. More...

#include <yarp/os/Face.h>

+ Inheritance diagram for yarp::os::Face:

Public Member Functions

 Face ()=default
 Constructor. More...
 
virtual ~Face ()=default
 Destructor. More...
 
virtual bool open (const Contact &address)=0
 Start listening to the given address. More...
 
virtual void close ()=0
 Stop listening. More...
 
virtual InputProtocolread ()=0
 Block and wait for someone to talk to us. More...
 
virtual OutputProtocolwrite (const Contact &address)=0
 Try to reach out and talk to someone. More...
 
virtual Contact getLocalAddress () const
 Get address after open(), if more specific that the address provided to open() - otherwise an invalid address is returned. More...
 

Detailed Description

The initial point-of-contact with a port.

Definition at line 23 of file Face.h.

Constructor & Destructor Documentation

◆ Face()

yarp::os::Face::Face ( )
default

Constructor.

◆ ~Face()

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

Destructor.

Member Function Documentation

◆ close()

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

Stop listening.

Implemented in yarp::os::impl::TcpFace, and yarp::os::impl::FakeFace.

◆ getLocalAddress()

virtual Contact yarp::os::Face::getLocalAddress ( ) const
inlinevirtual

Get address after open(), if more specific that the address provided to open() - otherwise an invalid address is returned.

Returns
an address

Reimplemented in yarp::os::impl::TcpFace.

Definition at line 86 of file Face.h.

◆ open()

virtual bool yarp::os::Face::open ( const Contact address)
pure virtual

Start listening to the given address.

Parameters
addressthe parameters needed for listening. E.g. for TCP, this would contain a socket number.
Returns
true on success.

Implemented in yarp::os::impl::TcpFace, and yarp::os::impl::FakeFace.

◆ read()

virtual InputProtocol* yarp::os::Face::read ( )
pure virtual

Block and wait for someone to talk to us.

Returns
a protocol object for talking to someone, or nullptr on failure.

Implemented in yarp::os::impl::TcpFace, and yarp::os::impl::FakeFace.

◆ write()

virtual OutputProtocol* yarp::os::Face::write ( const Contact address)
pure virtual

Try to reach out and talk to someone.

Parameters
addressparameters describing destination. For example, for TCP this would contain a machine name/IP address, and a socket number.
Returns
a protocol object to talk with, or nullptr on failure.

Implemented in yarp::os::impl::TcpFace, and yarp::os::impl::FakeFace.


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