YARP  2.3.70
Yet Another Robot Platform
yarp::os::SizedWriter Class Referenceabstract

Minimal requirements for an efficient Writer. More...

#include <yarp/os/SizedWriter.h>

+ Inheritance diagram for yarp::os::SizedWriter:

Public Member Functions

virtual ~SizedWriter ()
 
virtual size_t length ()=0
 
virtual size_t headerLength ()=0
 
virtual size_t length (size_t index)=0
 
virtual const char * data (size_t index)=0
 
virtual PortReadergetReplyHandler ()=0
 
virtual PortablegetReference ()=0
 
virtual void write (OutputStream &os)
 
virtual bool write (ConnectionWriter &connection) YARP_OVERRIDE
 Write this object to a network connection. More...
 
virtual bool dropRequested ()=0
 
virtual void startWrite ()=0
 Call when writing is about to begin. More...
 
virtual void stopWrite ()=0
 Call when all writing is finished. More...
 
virtual void clear ()
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor. More...
 
virtual void onCompletion ()
 This is called when the port has finished all writing operations. More...
 
virtual void onCommencement ()
 This is called when the port is about to begin writing operations. More...
 
virtual Type getWriteType ()
 

Detailed Description

Minimal requirements for an efficient Writer.

Some protocols require knowing the size of a message up front. In general, that requires generating the message before sending it, but a user could do something more clever. The SizedWriter class is referenced by the library instead of BufferedConnectionWriter specifically to leave that possibility open.

Definition at line 29 of file SizedWriter.h.

Constructor & Destructor Documentation

◆ ~SizedWriter()

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

Definition at line 31 of file SizedWriter.h.

Member Function Documentation

◆ clear()

virtual void yarp::os::SizedWriter::clear ( )
inlinevirtual

Reimplemented in yarp::os::impl::BufferedConnectionWriter.

Definition at line 76 of file SizedWriter.h.

◆ data()

virtual const char* yarp::os::SizedWriter::data ( size_t  index)
pure virtual

◆ dropRequested()

virtual bool yarp::os::SizedWriter::dropRequested ( )
pure virtual

◆ getReference()

virtual Portable* yarp::os::SizedWriter::getReference ( )
pure virtual

◆ getReplyHandler()

virtual PortReader* yarp::os::SizedWriter::getReplyHandler ( )
pure virtual

◆ headerLength()

virtual size_t yarp::os::SizedWriter::headerLength ( )
pure virtual

◆ length() [1/2]

virtual size_t yarp::os::SizedWriter::length ( )
pure virtual

◆ length() [2/2]

virtual size_t yarp::os::SizedWriter::length ( size_t  index)
pure virtual

◆ startWrite()

virtual void yarp::os::SizedWriter::startWrite ( )
pure virtual

Call when writing is about to begin.

Implemented in yarp::os::impl::BufferedConnectionWriter.

◆ stopWrite()

virtual void yarp::os::SizedWriter::stopWrite ( )
pure virtual

Call when all writing is finished.

Implemented in yarp::os::impl::BufferedConnectionWriter.

◆ write() [1/2]

virtual void yarp::os::SizedWriter::write ( OutputStream os)
inlinevirtual

Reimplemented in yarp::os::impl::BufferedConnectionWriter.

Definition at line 45 of file SizedWriter.h.

◆ write() [2/2]

virtual bool yarp::os::SizedWriter::write ( ConnectionWriter writer)
inlinevirtual

Write this object to a network connection.

Override this for your particular class. Be aware that depending on the nature of the connections a port has, and what protocol they use, and how efficient the YARP implementation is, this method may be called once, twice, or many times, as the result of a single call to Port::write

Parameters
writeran interface to the network connection for writing
Returns
true iff the object is successfully written

Implements yarp::os::PortWriter.

Reimplemented in yarp::os::impl::BufferedConnectionWriter.

Definition at line 52 of file SizedWriter.h.


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