YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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 chardata (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.
 
virtual bool dropRequested ()=0
 
virtual void startWrite () const =0
 Call when writing is about to begin.
 
virtual void stopWrite () const =0
 Call when all writing is finished.
 
virtual void clear ()
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor.
 
virtual void onCompletion () const
 This is called when the port has finished all writing operations.
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations.
 
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 31 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 32 of file SizedWriter.cpp.

◆ data()

virtual const char * yarp::os::SizedWriter::data ( size_t  index) const
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 ( ) const
pure virtual

◆ length() [1/2]

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

◆ 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

Call when writing is about to begin.

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

◆ stopWrite()

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

Call when all writing is finished.

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

◆ 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 24 of file SizedWriter.cpp.

◆ write() [2/2]

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

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

Definition at line 16 of file SizedWriter.cpp.


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