yarp-devices
Public Member Functions | Protected Attributes | List of all members
roboticslab::FutureTask Class Referenceabstract

Base class for a deferred task executor. More...

#include <FutureTask.hpp>

Inheritance diagram for roboticslab::FutureTask:
roboticslab::ParallelTask roboticslab::SequentialTask

Public Member Functions

virtual ~FutureTask ()=default
 Virtual destructor.
 
template<typename Fn , typename... Args>
void add (Fn &&fn, Args &&... args)
 Register a deferred callback given a free function.
 
template<typename T , typename Fn , typename... Args>
void add (T *p, Fn &&fn, Args &&... args)
 Register a deferred callback given a generic class instance.
 
virtual bool dispatch ()=0
 Dispatch the registered callbacks and returns their joint result.
 
unsigned int size () const
 Get the number of registered deferred callbacks.
 
void clear ()
 Clear internal list of deferred callbacks.
 

Protected Attributes

std::vector< std::function< bool(int)> > deferreds
 

Detailed Description

This class features a callback registry for instance methods that return a boolean value. The callbacks can be dispatched on request later on.


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