YARP
Yet Another Robot Platform
ShiftStream.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_SHIFTSTREAM_H
8 #define YARP_OS_SHIFTSTREAM_H
9 
10 #include <yarp/os/TwoWayStream.h>
11 
12 namespace yarp {
13 namespace os {
14 
23 {
24 public:
28  ShiftStream();
29 
33  virtual ~ShiftStream();
34 
38  virtual void check() const;
39 
40  InputStream& getInputStream() override;
41  OutputStream& getOutputStream() override;
42 
43  const Contact& getLocalAddress() const override;
44  const Contact& getRemoteAddress() const override;
45 
46  void close() override;
47 
53  virtual void takeStream(TwoWayStream* stream);
54 
61  virtual TwoWayStream* giveStream();
62 
67  virtual TwoWayStream* getStream() const;
68 
72  virtual bool isEmpty() const;
73 
74  bool isOk() const override;
75 
76  void reset() override;
77 
78  void beginPacket() override;
79 
80  void endPacket() override;
81 
82 #ifndef DOXYGEN_SHOULD_SKIP_THIS
83 private:
84  class Private;
85  Private* mPriv;
86 #endif // DOXYGEN_SHOULD_SKIP_THIS
87 };
88 
89 } // namespace os
90 } // namespace yarp
91 
92 #endif // YARP_OS_SHIFTSTREAM_H
Represents how to reach a part of a YARP network.
Definition: Contact.h:36
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:26
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:22
A container for a stream, allowing the stream implementation to be replaced when needed.
Definition: ShiftStream.h:23
A stream which can be asked to perform bidirectional communication.
Definition: TwoWayStream.h:26
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18