Allow lambdas as callback #2404
Labels
Component: Library - YARP_os
Type: Epic
Type: Modernization
Involves porting some part of code to modern C++ (11/14/17...)
Milestone
At the moment, all the callback mechanisms in YARP require writing a class that implement some interface, just to have a method that is called as callback. It would be a lot better to be able to pass lambdas to these functions.
Also in some cases it would be useful to receive a
std::future
in replyI'll keep a list here, and link to the related issues and PRs
yarp::os::Port::setReader()
requires ayarp::os::PortReader
yarp::os::Port::setReader()
yarp::os::Port::getReport()
andPort::setReporter()
require ayarp::os::PortReport
yarp::os::Port::getReport()
yarp::os::Port::setReporter()
yarp::os::Port::write()
requires ayarp::os::PortWriter
yarp::os::Port::write()
1/2yarp::os::Port::write()
2/2yarp::os::BufferedPort::useCallback()
requires ayarp::os::TypedReaderCallback
yarp::os::BufferedPort::useCallback()
The text was updated successfully, but these errors were encountered: