YARP
Yet Another Robot Platform
Face.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_OS_FACE_H
11 #define YARP_OS_FACE_H
12 
13 #include <yarp/os/Contact.h>
14 #include <yarp/os/InputProtocol.h>
15 #include <yarp/os/OutputProtocol.h>
16 
17 namespace yarp {
18 namespace os {
19 
24 {
25 public:
29  Face() = default;
30 
34  virtual ~Face() = default;
35 
46  virtual bool open(const Contact& address) = 0;
47 
53  virtual void close() = 0;
54 
63  virtual InputProtocol* read() = 0;
64 
75  virtual OutputProtocol* write(const Contact& address) = 0;
76 
77 
86  virtual Contact getLocalAddress() const
87  {
88  return Contact();
89  }
90 };
91 
92 } // namespace os
93 } // namespace yarp
94 
95 #endif // YARP_OS_FACE_H
yarp::os::OutputProtocol
The output side of an active connection between two ports.
Definition: OutputProtocol.h:33
yarp::os::Face::getLocalAddress
virtual Contact getLocalAddress() const
Get address after open(), if more specific that the address provided to open() - otherwise an invalid...
Definition: Face.h:86
yarp::os::Face::~Face
virtual ~Face()=default
Destructor.
InputProtocol.h
YARP_os_API
#define YARP_os_API
Definition: api.h:19
yarp::os::Face::close
virtual void close()=0
Stop listening.
yarp::os::Face::write
virtual OutputProtocol * write(const Contact &address)=0
Try to reach out and talk to someone.
yarp::os::Face::Face
Face()=default
Constructor.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::Contact
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
yarp::os::Face::open
virtual bool open(const Contact &address)=0
Start listening to the given address.
yarp::os::Face::read
virtual InputProtocol * read()=0
Block and wait for someone to talk to us.
yarp::os::InputProtocol
The input side of an active connection between two ports.
Definition: InputProtocol.h:38
Contact.h
yarp::os::Face
The initial point-of-contact with a port.
Definition: Face.h:24
OutputProtocol.h