YARP
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 () const =0
 
virtual size_t headerLength () const =0
 
virtual size_t length (size_t index) const =0
 
virtual const char * data (size_t index) const =0
 
virtual PortReadergetReplyHandler ()=0
 
virtual PortablegetReference ()=0
 
virtual void write (OutputStream &os)
 
bool write (ConnectionWriter &connection) const override
 Write this object to a network connection. More...
 
virtual bool dropRequested ()=0
 
virtual void startWrite () const =0
 Call when writing is about to begin. More...
 
virtual void stopWrite () const =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 () const
 This is called when the port has finished all writing operations. More...
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations. More...
 
virtual yarp::os::Type getWriteType () const
 

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 35 of file SizedWriter.h.

Constructor & Destructor Documentation

◆ ~SizedWriter()

yarp::os::SizedWriter::~SizedWriter ( )
virtualdefault

Member Function Documentation

◆ clear()

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

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

Definition at line 35 of file SizedWriter.cpp.

◆ data()

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

◆ dropRequested()

◆ getReference()

◆ getReplyHandler()

◆ headerLength()

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

◆ length() [1/2]

◆ length() [2/2]

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

◆ startWrite()

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

◆ stopWrite()

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

◆ write() [1/2]

bool yarp::os::SizedWriter::write ( ConnectionWriter writer) const
overridevirtual

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.

Definition at line 27 of file SizedWriter.cpp.

◆ write() [2/2]

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

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

Definition at line 19 of file SizedWriter.cpp.


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