MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
threaded_future.hpp File Reference
#include <chrono>
#include <future>
#include <thread>
#include <type_traits>
#include <utility>
Include dependency graph for threaded_future.hpp:
This graph shows which files directly or indirectly include this file:

Classes

class  moveit_pro::behaviors::ThreadedFuture< T >
 A future backed by an explicitly-owned std::jthread, for Behaviors that offload work to a background thread and poll for completion (e.g. in onRunning()). More...
 

Namespaces

namespace  moveit_pro
 
namespace  moveit_pro::behaviors
 

Functions

template<typename F >
auto moveit_pro::behaviors::runOnThread (F &&task) -> ThreadedFuture< std::invoke_result_t< std::decay_t< F > > >
 Runs task on a new std::jthread and returns a ThreadedFuture that tracks it, deducing the task's return type the same way std::async(std::launch::async, task) would.