YARP  2.3.68+272-20170522.1+git50f0ae7
Yet Another Robot Platform
yarp::os::OutputStream Class Referenceabstract

Simple specification of the minimum functions needed from output streams. More...

#include <yarp/os/OutputStream.h>

+ Inheritance diagram for yarp::os::OutputStream:

Public Member Functions

virtual ~OutputStream ()
 Destructor. More...
 
virtual void write (char ch)
 Write a single byte to the stream. More...
 
virtual void write (const Bytes &b, int offset, int len)
 Write a block of bytes to the stream. More...
 
virtual void write (const yarp::os::Bytes &b)=0
 Write a block of bytes to the stream. More...
 
virtual void close ()=0
 Terminate the stream. More...
 
virtual void flush ()
 Make sure all pending write operations are finished. More...
 
virtual void writeLine (const char *data, int len)
 Write some text followed by a line feed. More...
 
virtual bool isOk ()=0
 Check if the stream is ok or in an error state. More...
 
virtual bool setWriteTimeout (double timeout)
 Set activity timeout. More...
 
virtual bool setTypeOfService (int tos)
 
virtual int getTypeOfService ()
 

Detailed Description

Simple specification of the minimum functions needed from output streams.

The streams could be TCP, UDP, MCAST, ...

Definition at line 22 of file OutputStream.h.

Constructor & Destructor Documentation

◆ ~OutputStream()

virtual yarp::os::OutputStream::~OutputStream ( )
inlinevirtual

Destructor.

Definition at line 30 of file OutputStream.h.

Member Function Documentation

◆ close()

◆ flush()

virtual void yarp::os::OutputStream::flush ( )
inlinevirtual

Make sure all pending write operations are finished.

Reimplemented in yarp::os::impl::SocketTwoWayStream, yarp::os::impl::DgramTwoWayStream, and yarp::os::impl::ShmemTwoWayStream.

Definition at line 79 of file OutputStream.h.

◆ getTypeOfService()

virtual int yarp::os::OutputStream::getTypeOfService ( )
inlinevirtual

Reimplemented in yarp::os::impl::SocketTwoWayStream, and yarp::os::impl::DgramTwoWayStream.

Definition at line 125 of file OutputStream.h.

◆ isOk()

◆ setTypeOfService()

virtual bool yarp::os::OutputStream::setTypeOfService ( int  tos)
inlinevirtual

Reimplemented in yarp::os::impl::SocketTwoWayStream, and yarp::os::impl::DgramTwoWayStream.

Definition at line 118 of file OutputStream.h.

◆ setWriteTimeout()

virtual bool yarp::os::OutputStream::setWriteTimeout ( double  timeout)
inlinevirtual

Set activity timeout.

Support for this is optional. 0 = wait forever.

Returns
true iff timeout is supported.

Reimplemented in yarp::os::impl::SocketTwoWayStream.

Definition at line 111 of file OutputStream.h.

◆ write() [1/3]

virtual void yarp::os::OutputStream::write ( char  ch)
inlinevirtual

Write a single byte to the stream.

By default, this calls write(const Bytes& b) to do its work.

Parameters
chthe byte to write

Definition at line 40 of file OutputStream.h.

◆ write() [2/3]

virtual void yarp::os::OutputStream::write ( const Bytes b,
int  offset,
int  len 
)
inlinevirtual

Write a block of bytes to the stream.

By default, this calls write(const Bytes& b) to do its work.

Parameters
bthe bytes to write
offsetan offset within the block to start at
lenthe number of bytes to write

Definition at line 54 of file OutputStream.h.

◆ write() [3/3]

◆ writeLine()

virtual void yarp::os::OutputStream::writeLine ( const char *  data,
int  len 
)
inlinevirtual

Write some text followed by a line feed.

By default, this calls write(const Bytes& b) to do its work.

Parameters
datathe text to write

Definition at line 90 of file OutputStream.h.


The documentation for this class was generated from the following file: