transwarp
|
Detail namespace for internal functionality only. More...
Functions | |
template<typename TaskType > | |
std::shared_ptr< TaskType > | clone_task (std::unordered_map< std::shared_ptr< transwarp::itask >, std::shared_ptr< transwarp::itask >> &task_cache, const std::shared_ptr< TaskType > &t) |
Clones a task. | |
template<typename Functor , typename Tuple > | |
void | apply_to_each (Functor &&f, Tuple &&t) |
template<typename Functor , typename ElementType > | |
void | apply_to_each (Functor &&f, const std::vector< ElementType > &v) |
template<typename Functor , typename ElementType > | |
void | apply_to_each (Functor &&f, std::vector< ElementType > &v) |
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 task_id, const std::weak_ptr< Task > &task, Args &&... args) |
Runs the task with the given arguments, hence, invoking the task's functor. | |
template<typename... ParentResults> | |
void | wait_for_all (const std::tuple< 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 , typename... ParentResults> | |
void | cancel_all_but_one (const std::shared_ptr< transwarp::task< OneResult >> &one, const std::tuple< 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... ParentResults> | |
void | decrement_refcount (const std::tuple< std::shared_ptr< transwarp::task< ParentResults >>... > &parents) |
Decrements the refcount of all parents. | |
template<typename ParentResultType > | |
void | decrement_refcount (const std::vector< std::shared_ptr< transwarp::task< ParentResultType >>> &parents) |
Decrements the refcount of all parents. | |
template<typename TaskType , typename Result , typename Task , typename... ParentResults> | |
Result | call (std::size_t task_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 task_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 (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_task_if (Functor &functor, transwarp::itask &task) noexcept |
Assigns the task 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. | |
Variables | |
const transwarp::option_str | nullopt_string |
const transwarp::any_data | any_empty |
Detail namespace for internal functionality only.