YARP
Yet Another Robot Platform
ShiftStream.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_SHIFTSTREAM_H
11 #define YARP_OS_SHIFTSTREAM_H
12 
13 #include <yarp/os/TwoWayStream.h>
14 
15 namespace yarp {
16 namespace os {
17 
26 {
27 public:
31  ShiftStream();
32 
36  virtual ~ShiftStream();
37 
41  virtual void check() const;
42 
43  InputStream& getInputStream() override;
44  OutputStream& getOutputStream() override;
45 
46  const Contact& getLocalAddress() const override;
47  const Contact& getRemoteAddress() const override;
48 
49  void close() override;
50 
56  virtual void takeStream(TwoWayStream* stream);
57 
64  virtual TwoWayStream* giveStream();
65 
70  virtual TwoWayStream* getStream() const;
71 
75  virtual bool isEmpty() const;
76 
77  bool isOk() const override;
78 
79  void reset() override;
80 
81  void beginPacket() override;
82 
83  void endPacket() override;
84 
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS
86 private:
87  class Private;
88  Private* mPriv;
89 #endif // DOXYGEN_SHOULD_SKIP_THIS
90 };
91 
92 } // namespace os
93 } // namespace yarp
94 
95 #endif // YARP_OS_SHIFTSTREAM_H
yarp::os::TwoWayStream
A stream which can be asked to perform bidirectional communication.
Definition: TwoWayStream.h:29
yarp::os::OutputStream
Simple specification of the minimum functions needed from output streams.
Definition: OutputStream.h:25
YARP_os_API
#define YARP_os_API
Definition: api.h:19
TwoWayStream.h
yarp::os::ShiftStream
A container for a stream, allowing the stream implementation to be replaced when needed.
Definition: ShiftStream.h:26
yarp::os::ShiftStream::Private
Definition: ShiftStream.cpp:19
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::InputStream
Simple specification of the minimum functions needed from input streams.
Definition: InputStream.h:29