Simple specification of the minimum functions needed from output streams. More...
#include <yarp/os/OutputStream.h>
Public Member Functions | |
virtual | ~OutputStream () |
Destructor. | |
virtual void | write (char ch) |
Write a single byte to the stream. | |
virtual void | write (const Bytes &b, int offset, int len) |
Write a block of bytes to the stream. | |
virtual void | write (const yarp::os::Bytes &b)=0 |
Write a block of bytes to the stream. | |
virtual void | close ()=0 |
Terminate the stream. | |
virtual void | flush () |
Make sure all pending write operations are finished. | |
virtual void | writeLine (const char *data, int len) |
Write some text followed by a line feed. | |
virtual bool | isOk () const =0 |
Check if the stream is ok or in an error state. | |
virtual bool | setWriteTimeout (double timeout) |
Set activity timeout. | |
virtual bool | setTypeOfService (int tos) |
virtual int | getTypeOfService () |
Simple specification of the minimum functions needed from output streams.
The streams could be TCP, UDP, MCAST, ...
Definition at line 20 of file OutputStream.h.
|
virtualdefault |
Destructor.
Terminate the stream.
Implemented in GstreamerStream, HumanStream, MjpegStream, MpiBcastStream, MpiP2PStream, ShmemHybridStream, UnixSockTwoWayStream, WebSocketStream, yarp::os::impl::DgramTwoWayStream, yarp::os::impl::HttpTwoWayStream, yarp::os::impl::LocalCarrierStream, yarp::os::impl::MemoryOutputStream, yarp::os::impl::SocketTwoWayStream, yarp::os::StringOutputStream, yarp::os::NullStream, and MpiStream.
|
virtual |
Make sure all pending write operations are finished.
Reimplemented in yarp::os::impl::DgramTwoWayStream, and yarp::os::impl::SocketTwoWayStream.
Definition at line 25 of file OutputStream.cpp.
|
virtual |
Reimplemented in yarp::os::impl::DgramTwoWayStream, and yarp::os::impl::SocketTwoWayStream.
Definition at line 48 of file OutputStream.cpp.
Check if the stream is ok or in an error state.
Implemented in GstreamerStream, HumanStream, MjpegStream, MpiStream, ShmemHybridStream, UnixSockTwoWayStream, WebSocketStream, yarp::os::impl::DgramTwoWayStream, yarp::os::impl::HttpTwoWayStream, yarp::os::impl::LocalCarrierStream, yarp::os::impl::MemoryOutputStream, yarp::os::impl::SocketTwoWayStream, yarp::os::StringOutputStream, and yarp::os::NullStream.
Reimplemented in yarp::os::impl::DgramTwoWayStream, yarp::os::impl::LocalCarrierStream, and yarp::os::impl::SocketTwoWayStream.
Definition at line 42 of file OutputStream.cpp.
Set activity timeout.
Support for this is optional. 0 = wait forever.
Reimplemented in yarp::os::impl::SocketTwoWayStream.
Definition at line 36 of file OutputStream.cpp.
Write a single byte to the stream.
By default, this calls write(const Bytes& b) to do its work.
ch | the byte to write |
Reimplemented in yarp::os::StringOutputStream.
Definition at line 14 of file OutputStream.cpp.
Write a block of bytes to the stream.
By default, this calls write(const Bytes& b) to do its work.
b | the bytes to write |
offset | an offset within the block to start at |
len | the number of bytes to write |
Reimplemented in yarp::os::StringOutputStream.
Definition at line 19 of file OutputStream.cpp.
|
pure virtual |
Write a block of bytes to the stream.
b | the bytes to write |
Implemented in HumanStream, yarp::os::impl::HttpTwoWayStream, yarp::os::impl::SocketTwoWayStream, yarp::os::StringOutputStream, yarp::os::NullStream, GstreamerStream, MjpegStream, MpiBcastStream, MpiP2PStream, ShmemHybridStream, UnixSockTwoWayStream, yarp::os::impl::DgramTwoWayStream, yarp::os::impl::LocalCarrierStream, yarp::os::impl::MemoryOutputStream, MpiBcastStream, MpiP2PStream, MpiStream, yarp::os::StringOutputStream, and WebSocketStream.
Write some text followed by a line feed.
By default, this calls write(const Bytes& b) to do its work.
data | the text to write |
Definition at line 29 of file OutputStream.cpp.