transwarp
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Functions
transwarp::detail Namespace Reference

Detail namespace for internal functionality only. More...

Classes

struct  assign_node_if_impl
 
struct  node_manip
 Node manipulation. More...
 
class  thread_pool
 A simple thread pool used to execute tasks in parallel. More...
 
struct  call_with_futures_impl
 
struct  call_with_futures_impl< transwarp::root_type, true, total, n...>
 
struct  call_with_futures_impl< transwarp::accept_type, true, total, n...>
 
struct  call_with_futures_impl< transwarp::accept_any_type, true, total, n...>
 
struct  call_with_futures_impl< transwarp::consume_type, true, total, n...>
 
struct  call_with_futures_impl< transwarp::consume_any_type, true, total, n...>
 
struct  call_with_futures_impl< transwarp::wait_type, true, total, n...>
 
struct  call_with_futures_impl< transwarp::wait_any_type, true, total, n...>
 
struct  indices
 
struct  construct_range
 
struct  construct_range< end, idx, i...>
 
struct  construct_range< end, end, i...>
 
struct  index_range
 
struct  assign_futures_impl
 
struct  assign_futures_impl<-1, ParentResults...>
 
struct  parent_visitor
 Sets parents and level of the node. More...
 
struct  final_visitor
 Applies final bookkeeping to the task. More...
 
struct  graph_visitor
 Generates a graph. More...
 
struct  schedule_visitor
 Schedules using the given executor. More...
 
struct  reset_visitor
 Resets the given task. More...
 
struct  cancel_visitor
 Cancels or resumes the given task. More...
 
struct  set_executor_visitor
 Assigns an executor to the given task. More...
 
struct  remove_executor_visitor
 Removes the executor from the given task. More...
 
struct  set_priority_visitor
 Assigns a priority to the given task. More...
 
struct  reset_priority_visitor
 Resets the priority of the given task. More...
 
struct  set_custom_data_visitor
 Assigns custom data to the given task. More...
 
struct  remove_custom_data_visitor
 Removes custom data from the given task. More...
 
struct  push_task_visitor
 Pushes the given task into the vector of tasks. More...
 
struct  visit_depth
 Visits the given task using the visitor given in the constructor. More...
 
struct  unvisit
 Unvisits the given task. More...
 
struct  result
 Determines the result type of the Functor dispatching on the task type. More...
 
struct  result< transwarp::root_type, Functor, ParentResults...>
 
struct  result< transwarp::accept_type, Functor, ParentResults...>
 
struct  result< transwarp::accept_any_type, Functor, ParentResults...>
 
struct  result< transwarp::consume_type, Functor, ParentResults...>
 
struct  result< transwarp::consume_any_type, Functor, ParentResults...>
 
struct  result< transwarp::wait_type, Functor, ParentResults...>
 
struct  result< transwarp::wait_any_type, Functor, ParentResults...>
 
struct  assign_node_if_impl< true >
 
struct  assign_node_if_impl< false >
 
class  task_impl_base
 The base task class that contains the functionality that can be used with all result types (void and non-void) which is almost everything. More...
 
class  task_impl_proxy
 A task proxy for non-void result type. More...
 
class  task_impl_proxy< ResultType &, TaskType, Functor, ParentResults...>
 A task for non-void, non-const reference result type. More...
 
class  task_impl_proxy< void, TaskType, Functor, ParentResults...>
 A task for void result type. More...
 

Functions

template<typename Result , typename Task , typename... Args>
Result run_task (std::size_t node_id, const Task &task, Args &&...args)
 
void wait_for_all ()
 
template<typename Future , typename... ParentResults>
void wait_for_all (const Future &future, const std::shared_future< ParentResults > &...futures)
 Waits for all futures to finish.
 
template<typename FutureResult >
FutureResult wait_for_any_impl ()
 
template<typename FutureResult , typename Future , typename... ParentResults>
FutureResult wait_for_any_impl (const Future &future, const std::shared_future< ParentResults > &...futures)
 
template<typename FutureResult , typename... ParentResults>
FutureResult wait_for_any (const std::shared_future< ParentResults > &...futures)
 Waits for the first future to finish.
 
template<typename TaskType , typename Result , typename Task , typename... ParentResults>
Result call_with_futures (std::size_t node_id, const Task &task, const std::tuple< std::shared_future< ParentResults >...> &futures)
 Calls the functor of the given task with the results from the futures. 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. Expects the tuple to contain task pointers only and dereferences each element before passing it into the functor.
 
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 tasks.
 
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.
 

Detailed Description

Detail namespace for internal functionality only.