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

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

#include <yarp/os/PortReaderBuffer.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<class 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)

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

Definition at line 22 of file PortReaderBuffer.h.

Constructor & Destructor Documentation

◆ ~TypedReaderCallback()

template<class T>
virtual yarp::os::TypedReaderCallback< T >::~TypedReaderCallback ( )


Definition at line 52 of file PortReaderBuffer.h.

Member Function Documentation

◆ onRead() [1/2]

◆ onRead() [2/2]

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

Callback method.

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

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

Definition at line 70 of file PortReaderBuffer.h.

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