A container for a stream, allowing the stream implementation to be replaced when needed. More...
#include <yarp/os/ShiftStream.h>
Inheritance diagram for yarp::os::ShiftStream:Classes | |
| class | Private |
Public Member Functions | |
| ShiftStream () | |
| Constructor. | |
| virtual | ~ShiftStream () |
| Destructor. | |
| virtual void | check () const |
| Perform maintenance actions, if needed. | |
| InputStream & | getInputStream () override |
| Get an InputStream to read from. | |
| OutputStream & | getOutputStream () override |
| Get an OutputStream to write to. | |
| const Contact & | getLocalAddress () const override |
| Get the address of the local side of the stream. | |
| const Contact & | getRemoteAddress () const override |
| Get the address of the remote side of the stream. | |
| void | close () override |
| Terminate the stream. | |
| virtual void | takeStream (TwoWayStream *stream) |
| Wrap the supplied stream. | |
| virtual TwoWayStream * | giveStream () |
| Removes the wrapped stream and returns it. | |
| virtual TwoWayStream * | getStream () const |
| virtual bool | isEmpty () const |
| bool | isOk () const override |
| Check if the stream is ok or in an error state. | |
| void | reset () override |
| Reset the stream. | |
| void | beginPacket () override |
| Mark the beginning of a logical packet. | |
| void | endPacket () override |
| Mark the end of a logical packet (see beginPacket). | |
Public Member Functions inherited from yarp::os::TwoWayStream | |
| virtual | ~TwoWayStream () |
| Destructor. | |
A container for a stream, allowing the stream implementation to be replaced when needed.
This is important in YARP since connections "bootstrap" from an initial stream type to an optimized stream type with user-preferred properties and trade-offs.
Definition at line 21 of file ShiftStream.h.
| ShiftStream::ShiftStream | ( | ) |
Constructor.
Definition at line 43 of file ShiftStream.cpp.
|
virtual |
Destructor.
Definition at line 48 of file ShiftStream.cpp.
|
overridevirtual |
Mark the beginning of a logical packet.
This is a unit that should be treated in an atomic fashion by YARP. If any part is corrupted, the whole should be dropped.
Implements yarp::os::TwoWayStream.
Definition at line 132 of file ShiftStream.cpp.
|
virtual |
Perform maintenance actions, if needed.
Definition at line 53 of file ShiftStream.cpp.
|
overridevirtual |
Terminate the stream.
Implements yarp::os::TwoWayStream.
Definition at line 89 of file ShiftStream.cpp.
|
overridevirtual |
Mark the end of a logical packet (see beginPacket).
Implements yarp::os::TwoWayStream.
Definition at line 139 of file ShiftStream.cpp.
|
overridevirtual |
Get an InputStream to read from.
Implements yarp::os::TwoWayStream.
Definition at line 57 of file ShiftStream.cpp.
Get the address of the local side of the stream.
Implements yarp::os::TwoWayStream.
Definition at line 75 of file ShiftStream.cpp.
|
overridevirtual |
Get an OutputStream to write to.
Implements yarp::os::TwoWayStream.
Definition at line 66 of file ShiftStream.cpp.
Get the address of the remote side of the stream.
Implements yarp::os::TwoWayStream.
Definition at line 82 of file ShiftStream.cpp.
|
virtual |
Definition at line 107 of file ShiftStream.cpp.
|
virtual |
Removes the wrapped stream and returns it.
The caller will be responsible for closing the stream.
Definition at line 100 of file ShiftStream.cpp.
|
virtual |
Definition at line 112 of file ShiftStream.cpp.
|
overridevirtual |
Check if the stream is ok or in an error state.
Implements yarp::os::TwoWayStream.
Definition at line 117 of file ShiftStream.cpp.
|
overridevirtual |
Reset the stream.
Implements yarp::os::TwoWayStream.
Definition at line 125 of file ShiftStream.cpp.
|
virtual |
Wrap the supplied stream.
If a stream is already wrapped, it will be closed and destroyed.
| stream | the stream to wrap. |
Definition at line 94 of file ShiftStream.cpp.