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 26 of file TypedReaderCallback.h.

Constructor & Destructor Documentation

◆ ~TypedReaderCallback()

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

Destructor.

Definition at line 16 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 ImplementCallbackHelper2, yarp::os::BufferedPort< DepthImage >, yarp::os::BufferedPort< JoyData >, yarp::os::BufferedPort< return_getAllTransforms >, yarp::os::BufferedPort< ROS_MSG >, yarp::os::BufferedPort< SensorStreamingData >, JoypadControl::JoyPort< T >, yarp::os::BufferedPort< T >, yarp::os::Subscriber< T >, yarp::os::BufferedPort< VectorOf< unsigned char > >, yarp::os::BufferedPort< yarp::dev::impl::jointData >, yarp::os::BufferedPort< yarp::dev::LaserScan2D >, yarp::os::BufferedPort< yarp::dev::MobileBaseVelocity >, yarp::os::BufferedPort< yarp::dev::Nav2D::Map2DLocation >, yarp::os::BufferedPort< yarp::dev::OdometryData >, BatteryInputPortProcessor, Transforms_client_storage, yarp::dev::DeviceResponder, yarp::os::BufferedPort< yarp::os::PortablePair >, yarp::os::BufferedPort< yarp::rosmsg::geometry_msgs::PoseStamped >, yarp::os::BufferedPort< yarp::rosmsg::geometry_msgs::Twist >, yarp::os::Subscriber< yarp::rosmsg::geometry_msgs::Twist >, yarp::os::BufferedPort< yarp::rosmsg::geometry_msgs::WrenchStamped >, yarp::os::BufferedPort< yarp::rosmsg::nav_msgs::MapMetaData >, yarp::os::Subscriber< yarp::rosmsg::nav_msgs::MapMetaData >, yarp::os::BufferedPort< yarp::rosmsg::nav_msgs::OccupancyGrid >, yarp::os::Subscriber< yarp::rosmsg::nav_msgs::OccupancyGrid >, yarp::os::BufferedPort< yarp::rosmsg::nav_msgs::Odometry >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::CameraInfo >, yarp::os::Subscriber< yarp::rosmsg::sensor_msgs::CameraInfo >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::Image >, yarp::os::Subscriber< yarp::rosmsg::sensor_msgs::Image >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::Imu >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::JointState >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::LaserScan >, yarp::os::Subscriber< yarp::rosmsg::sensor_msgs::LaserScan >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::MagneticField >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::PointCloud2 >, yarp::os::BufferedPort< yarp::rosmsg::sensor_msgs::Temperature >, yarp::os::BufferedPort< yarp::rosmsg::tf2_msgs::TFMessage >, yarp::os::Subscriber< yarp::rosmsg::tf2_msgs::TFMessage >, yarp::os::BufferedPort< yarp::rosmsg::visualization_msgs::MarkerArray >, yarp::os::BufferedPort< yarp::sig::FlexImage >, yarp::os::BufferedPort< yarp::sig::ImageOf< yarp::sig::PixelFloat > >, yarp::os::BufferedPort< yarp::sig::Sound >, yarp::os::BufferedPort< yarp::sig::Vector >, and yarp::os::BufferedPort< yarp::sig::VectorOf >.

Definition at line 21 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 28 of file TypedReaderCallback-inl.h.


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