YARP
Yet Another Robot Platform
yarp::os::TypedReaderCallback< T > Class Template Reference

A callback for typed data from a port. More...

#include <yarp/os/TypedReaderCallback.h>

+ Inheritance diagram for yarp::os::TypedReaderCallback< T >:

Public Member Functions

virtual ~TypedReaderCallback ()
 Destructor. More...
 
virtual void onRead (T &datum)
 Callback method. More...
 
virtual void onRead (T &datum, const yarp::os::TypedReader< T > &reader)
 Callback method. More...
 

Detailed Description

template<typename T>
class yarp::os::TypedReaderCallback< T >

A callback for typed data from a port.

If you want to get your data while leaving the port free to read more in the background, you can create a callback that implements this interface, and tell the port about it using BufferedPort::useCallback(callback) or PortReaderBuffer::useCallback(callback)

Examples
port_power/ex0302_buffered_ext_callback.cpp, and port_power/ex0403_bufferedport_callback_reply.cpp.

Definition at line 30 of file TypedReaderCallback.h.

Constructor & Destructor Documentation

◆ ~TypedReaderCallback()

template<typename T >
yarp::os::TypedReaderCallback< T >::~TypedReaderCallback
virtual

Destructor.

Definition at line 19 of file TypedReaderCallback-inl.h.

Member Function Documentation

◆ onRead() [1/2]

template<typename T >
void yarp::os::TypedReaderCallback< T >::onRead ( T &  datum)
virtual

Callback method.

Parameters
datumdata read from a port

Reimplemented in yarp::os::BufferedPort< yarp::sig::VectorOf >, yarp::os::BufferedPort< yarp::sig::Vector >, yarp::os::BufferedPort< yarp::sig::Sound >, yarp::os::BufferedPort< yarp::sig::ImageOf< yarp::sig::PixelFloat > >, yarp::os::BufferedPort< yarp::sig::FlexImage >, yarp::os::BufferedPort< yarp::rosmsg::visualization_msgs::MarkerArray >, yarp::os::BufferedPort< yarp::rosmsg::tf2_msgs::TFMessage >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::Temperature >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::MagneticField >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::LaserScan >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::JointState >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::Imu >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::Image >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::CameraInfo >, yarp::os::BufferedPort< yarp::rosmsg::nav_msgs::Odometry >, yarp::os::BufferedPort< yarp::rosmsg::nav_msgs::OccupancyGrid >, yarp::os::BufferedPort< yarp::rosmsg::nav_msgs::MapMetaData >, yarp::os::BufferedPort< yarp::rosmsg::geometry_msgs::WrenchStamped >, yarp::os::BufferedPort< yarp::rosmsg::geometry_msgs::PoseStamped >, yarp::os::BufferedPort< yarp::os::PortablePair >, yarp::os::BufferedPort< yarp::os::Bottle >, yarp::os::BufferedPort< yarp::dev::OdometryData >, yarp::os::BufferedPort< yarp::dev::Nav2D::Map2DLocation >, yarp::os::BufferedPort< yarp::dev::LaserScan2D >, yarp::os::BufferedPort< yarp::dev::impl::jointData >, yarp::os::Subscriber< T >, yarp::os::BufferedPort< T >, JoypadControl::JoyPort< T >, yarp::os::BufferedPort< SensorStreamingData >, yarp::os::BufferedPort< ROS_MSG >, yarp::os::BufferedPort< JoyData >, yarp::os::BufferedPort< ImageType >, and yarp::os::BufferedPort< DepthImage >.

Definition at line 24 of file TypedReaderCallback-inl.h.

◆ onRead() [2/2]

template<typename T >
void yarp::os::TypedReaderCallback< T >::onRead ( T &  datum,
const yarp::os::TypedReader< T > &  reader 
)
virtual

Callback method.

Passes along source of callback. By default, this calls the version of onRead that just takes a datum.

Parameters
datumdata read from a port
readerthe original port (or delegate object)

Definition at line 31 of file TypedReaderCallback-inl.h.


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