YARP  2.3.68+272-20170522.1+git50f0ae7
Yet Another Robot Platform
yarp::os::Portable Class Referenceabstract

This is a base class for objects that can be both read from and be written to the YARP network. More...

#include <yarp/os/Portable.h>

+ Inheritance diagram for yarp::os::Portable:

Public Member Functions

virtual bool read (ConnectionReader &reader)=0
 Read this object from a network connection. More...
 
virtual bool write (ConnectionWriter &writer)=0
 Write this object to a network connection. More...
 
virtual Type getType ()
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType ()
 
- 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 ()
 

Static Public Member Functions

static bool copyPortable (PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading. More...
 

Detailed Description

This is a base class for objects that can be both read from and be written to the YARP network.

It is a simple union of PortReader and PortWriter.

Examples:
port_power/TargetVer2.h, and port_power/TargetVer3.h.

Definition at line 26 of file Portable.h.

Member Function Documentation

◆ copyPortable()

bool yarp::os::Portable::copyPortable ( PortWriter writer,
PortReader reader 
)
static

Copy one portable to another, via writing and reading.

Returns
true iff writer.write and reader.read both succeeded.

Definition at line 10 of file Portable.cpp.

◆ getType()

◆ read()

virtual bool yarp::os::Portable::read ( ConnectionReader reader)
pure virtual

◆ write()

virtual bool yarp::os::Portable::write ( ConnectionWriter writer)
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

Implements yarp::os::PortWriter.

Implemented in yarp::sig::Vector, yarp::os::impl::BottleImpl, yarp::os::Property, visualization_msgs_Marker, visualization_msgs_Marker, yarp::sig::Matrix, yarp::sig::Image, yarp::os::Bottle, sensor_msgs_CameraInfo, yarp::os::Value, sensor_msgs_LaserScan, sensor_msgs_PointCloud2, sensor_msgs_Imu, sensor_msgs_JointState, sensor_msgs_Image, sensor_msgs_PointField, yarp::os::ManagedBytes, yarp::math::Quaternion, sensor_msgs_RegionOfInterest, std_msgs_ColorRGBA, std_msgs_ColorRGBA, geometry_msgs_Quaternion, std_msgs_Header, geometry_msgs_TransformStamped, yarp::sig::Sound, jointData, geometry_msgs_Vector3, geometry_msgs_Point, geometry_msgs_Point, yarp::os::Stamp, visualization_msgs_MarkerArray, visualization_msgs_MarkerArray, tf_tfMessage, TickDuration, geometry_msgs_Transform, yarp::os::impl::Storable, geometry_msgs_Wrench, geometry_msgs_WrenchStamped, geometry_msgs_Pose, geometry_msgs_Pose, yarp::os::PortablePair< HEAD, BODY >, TickTime, yarp::sig::VectorBase, yarp::os::BinPortable< T >, yarp::os::idl::UnwrappedView< T >, yarp::os::SystemInfoSerializer, yarp::os::impl::PortCommand, and yarp::os::idl::Unwrapped< T >.

Examples:
port_power/TargetVer2.h, and port_power/TargetVer3.h.

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