YARP
Yet Another Robot Platform
OutputProtocol.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_OUTPUTPROTOCOL_H
11 #define YARP_OS_OUTPUTPROTOCOL_H
12 
13 #include <yarp/os/Connection.h>
15 #include <yarp/os/InputStream.h>
16 #include <yarp/os/Property.h>
17 #include <yarp/os/Route.h>
18 #include <yarp/os/SizedWriter.h>
19 
20 namespace yarp {
21 namespace os {
22 class InputProtocol;
23 class Contactable;
24 } // namespace os
25 } // namespace yarp
26 
27 namespace yarp {
28 namespace os {
33 {
34 public:
38  virtual ~OutputProtocol() = default;
39 
45  virtual bool open(const Route& route) = 0;
46 
52  virtual void rename(const Route& route) = 0;
53 
57  virtual void close() = 0;
58 
59  virtual const Route& getRoute() const = 0;
60 
64  virtual bool isOk() const = 0;
65 
69  virtual Connection& getConnection() = 0;
70 
77  virtual Connection& getReceiver() = 0;
78 
85  virtual Connection& getSender() = 0;
86 
95  virtual bool write(SizedWriter& writer) = 0;
96 
97  virtual void interrupt() = 0;
98 
99 
105  virtual InputProtocol& getInput() = 0;
106 
111 
115  virtual InputStream& getInputStream() = 0;
116 
120  virtual bool setTimeout(double timeout) = 0;
121 
125  virtual void attachPort(Contactable* port) = 0;
126 
131  virtual void beginWrite() = 0;
132 };
133 
134 } // namespace os
135 } // namespace yarp
136 
137 #endif // YARP_OS_OUTPUTPROTOCOL_H
yarp::os::OutputProtocol::interrupt
virtual void interrupt()=0
yarp::os::OutputProtocol
The output side of an active connection between two ports.
Definition: OutputProtocol.h:33
yarp::os::OutputProtocol::getOutputStream
virtual OutputStream & getOutputStream()=0
Access the output stream associated with the connection.
ConnectionWriter.h
yarp::os::OutputStream
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:25
yarp::os::OutputProtocol::getRoute
virtual const Route & getRoute() const =0
YARP_os_API
#define YARP_os_API
Definition: api.h:19
yarp::os::OutputProtocol::getInput
virtual InputProtocol & getInput()=0
Get an interface for doing read operations on the connection.
yarp::os::Route
Information about a connection between two ports.
Definition: Route.h:32
yarp::os::OutputProtocol::getInputStream
virtual InputStream & getInputStream()=0
Access the input stream associated with the connection.
yarp::os::OutputProtocol::getSender
virtual Connection & getSender()=0
It is possible to chain a basic connection with a modifier.
yarp::os::OutputProtocol::getReceiver
virtual Connection & getReceiver()=0
It is possible to chain a basic connection with a modifier.
yarp::os::OutputProtocol::open
virtual bool open(const Route &route)=0
Start negotiating a carrier, using the given route (this should generally match the name of the sendi...
Route.h
Property.h
yarp::os::OutputProtocol::getConnection
virtual Connection & getConnection()=0
Get the connection whose protocol operations we are managing.
yarp::os::OutputProtocol::rename
virtual void rename(const Route &route)=0
Relabel the route after the fact (e.g.
yarp::os::OutputProtocol::attachPort
virtual void attachPort(Contactable *port)=0
Set the port to be associated with the connection.
Connection.h
yarp::os::OutputProtocol::isOk
virtual bool isOk() const =0
Check if the connection is valid and can be used.
yarp::os::OutputProtocol::close
virtual void close()=0
Negotiate an end to operations.
yarp::os::OutputProtocol::setTimeout
virtual bool setTimeout(double timeout)=0
Set the timeout to be used for network operations.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::Connection
A controller for an individual connection.
Definition: Connection.h:30
InputStream.h
yarp::os::InputProtocol
The input side of an active connection between two ports.
Definition: InputProtocol.h:38
yarp::os::OutputProtocol::write
virtual bool write(SizedWriter &writer)=0
Write a message on the connection.
yarp::os::InputStream
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:29
yarp::os::OutputProtocol::beginWrite
virtual void beginWrite()=0
Notify connection that we intend to write to it.
SizedWriter.h
yarp::os::SizedWriter
Minimal requirements for an efficient Writer.
Definition: SizedWriter.h:36
yarp::os::OutputProtocol::~OutputProtocol
virtual ~OutputProtocol()=default
Destructor.
yarp::os::Contactable
An abstract port.
Definition: Contactable.h:38