|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
38 if (stream !=
nullptr) {
46 ShiftStream::ShiftStream() :
63 if (mPriv->stream ==
nullptr) {
64 return mPriv->nullStream;
66 return mPriv->stream->getInputStream();
72 if (mPriv->stream ==
nullptr) {
73 return mPriv->nullStream;
75 return mPriv->stream->getOutputStream();
81 return (mPriv->stream ==
nullptr) ? mPriv->nullStream.getLocalAddress()
82 : (mPriv->stream->getLocalAddress());
88 return (mPriv->stream ==
nullptr) ? mPriv->nullStream.getRemoteAddress()
89 : (mPriv->stream->getRemoteAddress());
100 mPriv->stream = stream;
106 mPriv->stream =
nullptr;
112 return mPriv->stream;
117 return mPriv->stream ==
nullptr;
122 if (mPriv->stream !=
nullptr) {
123 return mPriv->stream->isOk();
130 if (mPriv->stream !=
nullptr) {
131 mPriv->stream->reset();
137 if (mPriv->stream !=
nullptr) {
138 mPriv->stream->beginPacket();
144 if (mPriv->stream !=
nullptr) {
145 mPriv->stream->endPacket();
A stream which can be asked to perform bidirectional communication.
void beginPacket() override
Mark the beginning of a logical packet.
void close() override
Terminate the stream.
virtual TwoWayStream * giveStream()
Removes the wrapped stream and returns it.
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
virtual void takeStream(TwoWayStream *stream)
Wrap the supplied stream.
virtual void check() const
Perform maintenance actions, if needed.
Simple specification of the minimum functions needed from output streams.
virtual TwoWayStream * getStream() const
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
A "null" stream, always invalid.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
A container for a stream, allowing the stream implementation to be replaced when needed.
virtual ~ShiftStream()
Destructor.
OutputStream & getOutputStream() override
Get an OutputStream to write to.
InputStream & getInputStream() override
Get an InputStream to read from.
void reset() override
Reset the stream.
virtual bool isEmpty() const
bool isOk() const override
Check if the stream is ok or in an error state.