YARP
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 () const =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 24 of file OutputStream.h.

Constructor & Destructor Documentation

◆ ~OutputStream()

yarp::os::OutputStream::~OutputStream ( )
virtualdefault

Destructor.

Member Function Documentation

◆ close()

◆ flush()

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

Make sure all pending write operations are finished.

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

Definition at line 28 of file OutputStream.cpp.

◆ getTypeOfService()

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

◆ isOk()

◆ setTypeOfService()

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

◆ setWriteTimeout()

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

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 39 of file OutputStream.cpp.

◆ write() [1/3]

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

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 17 of file OutputStream.cpp.

◆ write() [2/3]

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

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 22 of file OutputStream.cpp.

◆ write() [3/3]

◆ writeLine()

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

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 32 of file OutputStream.cpp.


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