YARP  2.3.72
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)

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

Definition at line 13 of file TypedReaderCallback.h.

Constructor & Destructor Documentation

◆ ~TypedReaderCallback()

template<typename T >
yarp::os::TypedReaderCallback< T >::~TypedReaderCallback ( )


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

Member Function Documentation

◆ onRead() [1/2]

◆ onRead() [2/2]

template<typename T >
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 28 of file TypedReaderCallback-inl.h.

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