YARP
Yet Another Robot Platform
yarp::os::PortWriter Class Referenceabstract

Interface implemented by all objects that can write themselves to the network, such as Bottle objects. More...

#include <yarp/os/PortWriter.h>

+ Inheritance diagram for yarp::os::PortWriter:

Detailed Description

Interface implemented by all objects that can write themselves to the network, such as Bottle objects.

See also
Port, PortReader

Definition at line 26 of file PortWriter.h.

Public Member Functions

virtual ~PortWriter ()
 Destructor. More...
 
virtual bool write (ConnectionWriter &writer) const =0
 Write this object to a network connection. 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
 

Constructor & Destructor Documentation

◆ ~PortWriter()

yarp::os::PortWriter::~PortWriter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getWriteType()

yarp::os::Type yarp::os::PortWriter::getWriteType ( ) const
virtual

Definition at line 24 of file PortWriter.cpp.

◆ onCommencement()

void yarp::os::PortWriter::onCommencement ( ) const
virtual

This is called when the port is about to begin writing operations.

After this point, the write method may be called zero, once, or many times by YARP depending on the mix of formats and protocols in use.

Reimplemented in yarp::os::Bottle.

Definition at line 20 of file PortWriter.cpp.

◆ onCompletion()

void yarp::os::PortWriter::onCompletion ( ) const
virtual

This is called when the port has finished all writing operations.

Reimplemented in yarp::os::PortablePair< HEAD, BODY >.

Definition at line 16 of file PortWriter.cpp.

◆ write()

virtual bool yarp::os::PortWriter::write ( ConnectionWriter writer) const
pure virtual

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

Implemented in jointData::Editor, yarp::sig::Vector, yarp::os::Property, yarp::os::Value, yarp::sig::Matrix, yarp::sig::PointCloud< T >, yarp::os::Bottle, yarp::sig::Image, yarp::dev::MapGrid2D, yarp::os::impl::BufferedConnectionWriter, yarp::math::Quaternion, yarp::os::ManagedBytes, jointData, yarp::sig::Sound, yarp::math::Vec2D< T >, yarp::os::impl::ConnectionRecorder, yarp::os::Stamp, yarp::os::impl::Storable, yarp::math::Vec2D< T >, yarp::os::PortablePair< HEAD, BODY >, yarp::math::Vec2D< T >, yarp::sig::VectorBase, yarp::sig::PointCloudBase, yarp::os::idl::UnwrappedView< T >, yarp::os::SizedWriter, JoyData, yarp::os::BinPortable< T >, yarp::os::SystemInfoSerializer, yarp::os::impl::PortCommand, yarp::os::idl::Unwrapped< T >, and yarp::os::Portable.


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