#include <functional>#include <vector>#include <dispenso/detail/future_impl.h>#include <dispenso/detail/result_of.h>#include <dispenso/schedulable.h>#include <dispenso/detail/future_impl2.h>Go to the source code of this file.
Classes | |
| class | dispenso::Future< Result > |
| class | dispenso::Future< Result & > |
| class | dispenso::Future< void > |
Functions | |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (std::launch policy, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (ThreadPool &pool, std::launch policy, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (ThreadPool &pool, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (TaskSet &tasks, std::launch policy, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (TaskSet &tasks, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (ConcurrentTaskSet &tasks, std::launch policy, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (ConcurrentTaskSet &tasks, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (NewThreadInvoker sched, std::launch policy, F &&f, Args &&... args) |
| template<class F , class... Args> | |
| Future< detail::ResultOf< F, Args... > > | dispenso::async (NewThreadInvoker sched, F &&f, Args &&... args) |
| template<typename T > | |
| Future< std::decay_t< T > > | dispenso::make_ready_future (T &&t) |
| template<typename X > | |
| Future< X & > | dispenso::make_ready_future (std::reference_wrapper< X > x) |
| Future< void > | dispenso::make_ready_future () |
| template<class InputIt > | |
| Future< std::vector< typename std::iterator_traits< InputIt >::value_type > > | dispenso::when_all (InputIt first, InputIt last) |
| template<class... Futures> | |
| auto | dispenso::when_all (Futures &&... futures) -> Future< std::tuple< std::decay_t< Futures >... > > |
| template<class InputIt > | |
| Future< std::vector< typename std::iterator_traits< InputIt >::value_type > > | dispenso::when_all (TaskSet &taskSet, InputIt first, InputIt last) |
| template<class InputIt > | |
| Future< std::vector< typename std::iterator_traits< InputIt >::value_type > > | dispenso::when_all (ConcurrentTaskSet &taskSet, InputIt first, InputIt last) |
| template<class... Futures> | |
| auto | dispenso::when_all (TaskSet &taskSet, Futures &&... futures) -> Future< std::tuple< std::decay_t< Futures >... > > |
| template<class... Futures> | |
| auto | dispenso::when_all (ConcurrentTaskSet &taskSet, Futures &&... futures) -> Future< std::tuple< std::decay_t< Futures >... > > |
Variables | |
| constexpr std::launch | dispenso::kNotAsync = static_cast<std::launch>(0) |
| constexpr std::launch | dispenso::kNotDeferred = static_cast<std::launch>(0) |
A file providing Futures, as well as functionality for creating futures, and for how to invoke Futures' closures.
See https://en.cppreference.com/w/cpp/experimental/future for details on the API.
Definition in file future.h.
|
inline |
|
inline |
Invoke a functor through the specified dispenso ConcurrentTaskSet.
| tasks | The ConcurrentTaskSet to run the Future. |
| policy | The bitmask policy for when/how the functor can be invoked. std::launch::async will result in the functor being forced onto a ThreadPool work queue. std::launch::deferred specifies that Future::wait_for and Future::wait_until may invoke the functor. |
| f | The functor to be passed, or a function to be executed |
| args | The remaining arguments that will be passed to f |
|
inline |
|
inline |
|
inline |
Invoke a functor on a new thread.
| sched | A NewThreadInvoker |
| policy | The bitmask policy for when/how the functor can be invoked. std::launch::async will result in the functor being forced onto a ThreadPool work queue. std::launch::deferred specifies that Future::wait_for and Future::wait_until may invoke the functor. |
| f | The functor to be passed, or a function to be executed |
| args | The remaining arguments that will be passed to f |
|
inline |
Invoke a functor through the global dispenso thread pool.
| policy | The bitmask policy for when/how the functor can be invoked. std::launch::async will result in the functor being forced onto a ThreadPool work queue. std::launch::deferred specifies that Future::wait_for and Future::wait_until may invoke the functor. |
| f | The functor to be passed, or a function to be executed |
| args | The remaining arguments that will be passed to f |
|
inline |
|
inline |
Invoke a functor through the specified dispenso TaskSet.
| tasks | The TaskSet to run the Future. |
| policy | The bitmask policy for when/how the functor can be invoked. std::launch::async will result in the functor being forced onto a ThreadPool work queue. std::launch::deferred specifies that Future::wait_for and Future::wait_until may invoke the functor. |
| f | The functor to be passed, or a function to be executed |
| args | The remaining arguments that will be passed to f |
|
inline |
|
inline |
Invoke a functor through the specified dispenso thread pool.
| pool | The ThreadPool to run the Future. |
| policy | The bitmask policy for when/how the functor can be invoked. std::launch::async will result in the functor being forced onto a ThreadPool work queue. std::launch::deferred specifies that Future::wait_for and Future::wait_until may invoke the functor. |
| f | The functor to be passed, or a function to be executed |
| args | The remaining arguments that will be passed to f |
|
inline |
|
inline |
|
inline |
| auto dispenso::when_all | ( | Futures &&... | futures | ) | -> Future< std::tuple< std::decay_t< Futures >... > > |
Take a specific set of futures, and return a future which will be ready when all input futures are ready.
| futures | A parameter pack of futures. |
| Future< std::vector< typename std::iterator_traits< InputIt >::value_type > > dispenso::when_all | ( | InputIt | first, |
| InputIt | last ) |
Take a collection of futures, and return a future which will be ready when all input futures are ready.
| first | An iterator to the start of the future collection. |
| last | An iterator to the end of the future collection. |
| auto dispenso::when_all | ( | TaskSet & | taskSet, |
| Futures &&... | futures ) -> Future< std::tuple< std::decay_t< Futures >... > > |
Take a specific set of futures, and return a future which will be ready when all input futures are ready.
| tastSet | A task set to register with such that after this call, taskSet::wait() implies that the resultant future is_ready() |
| futures | A parameter pack of futures. |
| Future< std::vector< typename std::iterator_traits< InputIt >::value_type > > dispenso::when_all | ( | TaskSet & | taskSet, |
| InputIt | first, | ||
| InputIt | last ) |
Take a collection of futures, and return a future which will be ready when all input futures are ready.
| tastSet | A task set to register with such that after this call, taskSet::wait() implies that the resultant future is_ready() |
| first | An iterator to the start of the future collection. |
| last | An iterator to the end of the future collection. |
|
constexpr |