YARP
Yet Another Robot Platform
yarp::os::impl::FakeFace Class Reference

A dummy Face for testing purposes. More...

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

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

Public Member Functions

bool open (const Contact &address) override
 Start listening to the given address. More...
 
void close () override
 Stop listening. More...
 
InputProtocolread () override
 Block and wait for someone to talk to us. More...
 
OutputProtocolwrite (const Contact &address) override
 Try to reach out and talk to someone. More...
 
- Public Member Functions inherited from yarp::os::Face
 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

A dummy Face for testing purposes.

Definition at line 17 of file FakeFace.h.

Member Function Documentation

◆ close()

void FakeFace::close ( )
overridevirtual

Stop listening.

Implements yarp::os::Face.

Definition at line 22 of file FakeFace.cpp.

◆ open()

bool FakeFace::open ( const Contact address)
overridevirtual

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.

Implements yarp::os::Face.

Definition at line 15 of file FakeFace.cpp.

◆ read()

InputProtocol * FakeFace::read ( )
overridevirtual

Block and wait for someone to talk to us.

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

Implements yarp::os::Face.

Definition at line 26 of file FakeFace.cpp.

◆ write()

OutputProtocol * FakeFace::write ( const Contact address)
overridevirtual

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.

Implements yarp::os::Face.

Definition at line 32 of file FakeFace.cpp.


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