A container for a stream, allowing the stream implementation to be replaced when needed. More...
#include <yarp/os/ShiftStream.h>
Classes | |
class | Private |
Public Member Functions | |
ShiftStream () | |
Constructor. More... | |
virtual | ~ShiftStream () |
Destructor. More... | |
virtual void | check () const |
Perform maintenance actions, if needed. More... | |
InputStream & | getInputStream () override |
Get an InputStream to read from. More... | |
OutputStream & | getOutputStream () override |
Get an OutputStream to write to. More... | |
const Contact & | getLocalAddress () const override |
Get the address of the local side of the stream. More... | |
const Contact & | getRemoteAddress () const override |
Get the address of the remote side of the stream. More... | |
void | close () override |
Terminate the stream. More... | |
virtual void | takeStream (TwoWayStream *stream) |
Wrap the supplied stream. More... | |
virtual TwoWayStream * | giveStream () |
Removes the wrapped stream and returns it. More... | |
virtual TwoWayStream * | getStream () const |
virtual bool | isEmpty () const |
bool | isOk () const override |
Check if the stream is ok or in an error state. More... | |
void | reset () override |
Reset the stream. More... | |
void | beginPacket () override |
Mark the beginning of a logical packet. More... | |
void | endPacket () override |
Mark the end of a logical packet (see beginPacket). More... | |
Public Member Functions inherited from yarp::os::TwoWayStream | |
virtual | ~TwoWayStream () |
Destructor. More... | |
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 25 of file ShiftStream.h.
ShiftStream::ShiftStream | ( | ) |
Constructor.
Definition at line 46 of file ShiftStream.cpp.
|
virtual |
Destructor.
Definition at line 51 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 135 of file ShiftStream.cpp.
|
virtual |
Perform maintenance actions, if needed.
Definition at line 56 of file ShiftStream.cpp.
|
overridevirtual |
Terminate the stream.
Implements yarp::os::TwoWayStream.
Definition at line 92 of file ShiftStream.cpp.
|
overridevirtual |
Mark the end of a logical packet (see beginPacket).
Implements yarp::os::TwoWayStream.
Definition at line 142 of file ShiftStream.cpp.
|
overridevirtual |
Get an InputStream to read from.
Implements yarp::os::TwoWayStream.
Definition at line 60 of file ShiftStream.cpp.
|
overridevirtual |
Get the address of the local side of the stream.
Implements yarp::os::TwoWayStream.
Definition at line 78 of file ShiftStream.cpp.
|
overridevirtual |
Get an OutputStream to write to.
Implements yarp::os::TwoWayStream.
Definition at line 69 of file ShiftStream.cpp.
|
overridevirtual |
Get the address of the remote side of the stream.
Implements yarp::os::TwoWayStream.
Definition at line 85 of file ShiftStream.cpp.
|
virtual |
Definition at line 110 of file ShiftStream.cpp.
|
virtual |
Removes the wrapped stream and returns it.
The caller will be responsible for closing the stream.
Definition at line 103 of file ShiftStream.cpp.
|
virtual |
Definition at line 115 of file ShiftStream.cpp.
|
overridevirtual |
Check if the stream is ok or in an error state.
Implements yarp::os::TwoWayStream.
Definition at line 120 of file ShiftStream.cpp.
|
overridevirtual |
Reset the stream.
Implements yarp::os::TwoWayStream.
Definition at line 128 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 97 of file ShiftStream.cpp.