YARP
Yet Another Robot Platform
ConnectionState.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_OS_CONNECTIONSTATE_H
10 #define YARP_OS_CONNECTIONSTATE_H
11 
12 #include <yarp/os/api.h>
13 
14 #include <string>
15 
16 namespace yarp {
17 namespace os {
18 
19 class Connection;
20 class InputStream;
21 class OutputStream;
22 class Portable;
23 class Route;
24 class TwoWayStream;
25 class Contactable;
26 
31 {
32 public:
36  virtual ~ConnectionState();
37 
42  virtual const Route& getRoute() const = 0;
43 
47  virtual void setRoute(const Route& route) = 0;
48 
52  virtual OutputStream& getOutputStream() = 0;
53 
57  virtual InputStream& getInputStream() = 0;
58 
62  virtual Connection& getConnection() = 0;
63 
69  virtual void setRemainingLength(int len) = 0;
70 
75  virtual std::string getSenderSpecifier() const = 0;
76 
81  virtual TwoWayStream& getStreams() = 0;
82 
88  virtual void takeStreams(TwoWayStream* streams) = 0;
89 
95  virtual TwoWayStream* giveStreams() = 0;
96 
102  virtual void setReference(yarp::os::Portable* ref) = 0;
103 
107  virtual bool checkStreams() const = 0;
108 
112  virtual Contactable* getContactable() const = 0;
113 
118  {
119  return getOutputStream();
120  }
121 
126  {
127  return getInputStream();
128  }
129 
133  virtual const std::string& getEnvelope() const = 0;
134 };
135 
136 
137 } // namespace os
138 } // namespace yarp
139 
140 #endif // YARP_OS_CONNECTIONSTATE_H
yarp::os::TwoWayStream
A stream which can be asked to perform bidirectional communication.
Definition: TwoWayStream.h:28
yarp::os::Portable
Definition: Portable.h:28
yarp::os::OutputStream
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:24
yarp::os::Route
Information about a connection between two ports.
Definition: Route.h:31
yarp::os::ConnectionState::os
OutputStream & os()
Shorthand for getOutputStream()
Definition: ConnectionState.h:117
yarp::os::ConnectionState
The basic state of a connection - route, streams in use, etc.
Definition: ConnectionState.h:30
yarp
Definition: environment.h:18
yarp::os::Connection
A controller for an individual connection.
Definition: Connection.h:29
YARP_os_API
#define YARP_os_API
Definition: api.h:19
yarp::os::ConnectionState::is
InputStream & is()
Shorthand for getInputStream()
Definition: ConnectionState.h:125
api.h
yarp::os::InputStream
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:28
yarp::os::Contactable
An abstract port.
Definition: Contactable.h:37