YARP
Yet Another Robot Platform
Face.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_OS_FACE_H
8#define YARP_OS_FACE_H
9
10#include <yarp/os/Contact.h>
13
14namespace yarp::os {
15
20{
21public:
25 Face() = default;
26
30 virtual ~Face() = default;
31
42 virtual bool open(const Contact& address) = 0;
43
49 virtual void close() = 0;
50
59 virtual InputProtocol* read() = 0;
60
71 virtual OutputProtocol* write(const Contact& address) = 0;
72
73
82 virtual Contact getLocalAddress() const
83 {
84 return Contact();
85 }
86};
87
88} // namespace yarp::os
89
90#endif // YARP_OS_FACE_H
Represents how to reach a part of a YARP network.
Definition: Contact.h:33
The initial point-of-contact with a port.
Definition: Face.h:20
virtual ~Face()=default
Destructor.
virtual InputProtocol * read()=0
Block and wait for someone to talk to us.
virtual Contact getLocalAddress() const
Get address after open(), if more specific that the address provided to open() - otherwise an invalid...
Definition: Face.h:82
virtual OutputProtocol * write(const Contact &address)=0
Try to reach out and talk to someone.
Face()=default
Constructor.
virtual void close()=0
Stop listening.
virtual bool open(const Contact &address)=0
Start listening to the given address.
The input side of an active connection between two ports.
Definition: InputProtocol.h:32
The output side of an active connection between two ports.
An interface to the operating system, including Port based communication.
#define YARP_os_API
Definition: api.h:18