Minimal requirements for an efficient Writer. More...
#include <yarp/os/SizedWriter.h>
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 PortReader * | getReplyHandler ()=0 |
virtual Portable * | getReference ()=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 |
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.
|
virtualdefault |
|
virtual |
Reimplemented in yarp::os::impl::BufferedConnectionWriter.
Definition at line 35 of file SizedWriter.cpp.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Call when writing is about to begin.
Implemented in yarp::wire_rep_utils::WireTwiddlerWriter, yarp::wire_rep_utils::RosWireImage, yarp::wire_rep_utils::SizedWriterTail, and yarp::os::impl::BufferedConnectionWriter.
|
pure virtual |
Call when all writing is finished.
Implemented in yarp::wire_rep_utils::WireTwiddlerWriter, yarp::wire_rep_utils::RosWireImage, yarp::wire_rep_utils::SizedWriterTail, and yarp::os::impl::BufferedConnectionWriter.
|
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
writer | an interface to the network connection for writing |
Implements yarp::os::PortWriter.
Definition at line 27 of file SizedWriter.cpp.
|
virtual |
Reimplemented in yarp::os::impl::BufferedConnectionWriter.
Definition at line 19 of file SizedWriter.cpp.