Detail namespace for internal functionality only. More...
Functions | |
template<typename... ParentResults> | |
std::tuple< std::shared_future < ParentResults >...> | get_futures (const std::tuple< std::shared_ptr< transwarp::task< ParentResults >>...> &input) |
Returns the futures from the given tuple of tasks. | |
template<typename ParentResultType > | |
std::vector < std::shared_future < ParentResultType > > | get_futures (const std::vector< std::shared_ptr< transwarp::task< ParentResultType >>> &input) |
Returns the futures from the given vector of tasks. | |
template<typename Result , typename Task , typename... Args> | |
Result | run_task (std::size_t node_id, const std::weak_ptr< Task > &task, Args &&...args) |
Runs the task with the given arguments, hence, invoking the task's functor. | |
void | wait_for_all () |
template<typename ParentResult , typename... ParentResults> | |
void | wait_for_all (const std::shared_ptr< transwarp::task< ParentResult >> &parent, const std::shared_ptr< transwarp::task< ParentResults >> &...parents) |
Waits for all parents to finish. | |
template<typename ParentResultType > | |
void | wait_for_all (const std::vector< std::shared_ptr< transwarp::task< ParentResultType >>> &parents) |
Waits for all parents to finish. | |
template<typename Parent > | |
Parent | wait_for_any_impl () |
template<typename Parent , typename ParentResult , typename... ParentResults> | |
Parent | wait_for_any_impl (const std::shared_ptr< transwarp::task< ParentResult >> &parent, const std::shared_ptr< transwarp::task< ParentResults >> &...parents) |
template<typename Parent , typename... ParentResults> | |
Parent | wait_for_any (const std::shared_ptr< transwarp::task< ParentResults >> &...parents) |
Waits for the first parent to finish. | |
template<typename ParentResultType > | |
std::shared_ptr < transwarp::task < ParentResultType > > | wait_for_any (const std::vector< std::shared_ptr< transwarp::task< ParentResultType >>> &parents) |
Waits for the first parent to finish. | |
template<typename OneResult > | |
void | cancel_all_but_one (const std::shared_ptr< transwarp::task< OneResult >> &) |
template<typename OneResult , typename ParentResult , typename... ParentResults> | |
void | cancel_all_but_one (const std::shared_ptr< transwarp::task< OneResult >> &one, const std::shared_ptr< transwarp::task< ParentResult >> &parent, const std::shared_ptr< transwarp::task< ParentResults >> &...parents) |
Cancels all tasks but one. | |
template<typename OneResult , typename ParentResultType > | |
void | cancel_all_but_one (const std::shared_ptr< transwarp::task< OneResult >> &one, const std::vector< std::shared_ptr< transwarp::task< ParentResultType >>> &parents) |
Cancels all tasks but one. | |
template<typename TaskType , typename Result , typename Task , typename... ParentResults> | |
Result | call (std::size_t node_id, const Task &task, const std::tuple< std::shared_ptr< transwarp::task< ParentResults >>...> &parents) |
Calls the functor of the given task with the results from the tuple of parents. Throws transwarp::task_canceled if the task is canceled. Throws transwarp::task_destroyed in case the task was destroyed prematurely. | |
template<typename TaskType , typename Result , typename Task , typename ParentResultType > | |
Result | call (std::size_t node_id, const Task &task, const std::vector< std::shared_ptr< transwarp::task< ParentResultType >>> &parents) |
Calls the functor of the given task with the results from the vector of parents. Throws transwarp::task_canceled if the task is canceled. Throws transwarp::task_destroyed in case the task was destroyed prematurely. | |
template<typename Functor , typename... ParentResults> | |
void | call_with_each_index (transwarp::detail::indices<>, const Functor &, const std::tuple< std::shared_ptr< transwarp::task< ParentResults >>...> &) |
template<std::size_t i, std::size_t... j, typename Functor , typename... ParentResults> | |
void | call_with_each_index (transwarp::detail::indices< i, j...>, const Functor &f, const std::tuple< std::shared_ptr< transwarp::task< ParentResults >>...> &t) |
template<typename Functor , typename... ParentResults> | |
void | call_with_each (const Functor &f, const std::tuple< std::shared_ptr< transwarp::task< ParentResults >>...> &t) |
Calls the functor with every element in the tuple. | |
template<typename Functor , typename ParentResultType > | |
void | call_with_each (const Functor &f, const std::vector< std::shared_ptr< transwarp::task< ParentResultType >>> &v) |
Calls the functor with every element in the vector. | |
template<typename Functor > | |
void | assign_node_if (Functor &functor, std::shared_ptr< transwarp::node > node) noexcept |
Assigns the node to the given functor if the functor is a subclass of transwarp::functor. | |
template<typename ResultType , typename Value > | |
std::shared_future< ResultType > | make_future_with_value (Value &&value) |
Returns a ready future with the given value as its state. | |
std::shared_future< void > | make_ready_future () |
Returns a ready future. | |
template<typename ResultType > | |
std::shared_future< ResultType > | make_future_with_exception (std::exception_ptr exception) |
Returns a ready future with the given exception as its state. | |
Detail namespace for internal functionality only.