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

The transwarp namespace. More...

Namespaces

 detail
 Detail namespace for internal functionality only.
 

Classes

struct  root_type
 The root type. Used for tag dispatch. More...
 
struct  accept_type
 The accept type. Used for tag dispatch. More...
 
struct  accept_any_type
 The accept_any type. Used for tag dispatch. More...
 
struct  consume_type
 The consume type. Used for tag dispatch. More...
 
struct  consume_any_type
 The consume_any type. Used for tag dispatch. More...
 
struct  wait_type
 The wait type. Used for tag dispatch. More...
 
struct  wait_any_type
 The wait_any type. Used for tag dispatch. More...
 
class  node
 A node carrying meta-data of a task. More...
 
class  edge
 An edge between two nodes. More...
 
class  executor
 The executor interface. More...
 
class  listener
 The listener interface. More...
 
class  itask
 An interface for the task class. More...
 
struct  remove_refc
 Removes reference and const from a type. More...
 
struct  result_info
 Returns the result type of a std::shared_future<T> More...
 
class  task
 The task class (non-void result type) More...
 
class  task< ResultType & >
 The task class (non-void, non-const reference result type) More...
 
class  task< void >
 The task class (void result type) More...
 
class  transwarp_error
 Base class for exceptions. More...
 
class  task_canceled
 Exception thrown when a task is canceled. More...
 
class  task_destroyed
 Exception thrown when a task was destroyed prematurely. More...
 
class  thread_pool_error
 An exception for errors in the thread_pool class. More...
 
class  functor
 A base class for a user-defined functor that needs access to the node associated to the task or a cancel point to stop a task while it's running. More...
 
class  sequential
 Executor for sequential execution. Runs functors sequentially on the same thread. More...
 
class  parallel
 Executor for parallel execution. Uses a simple thread pool. More...
 
class  task_impl
 A task representing a piece of work given by functor and parent tasks. By connecting tasks a directed acyclic graph is built. Tasks should be created using the make_task factory functions. More...
 
class  value_task
 A value task that stores a single value and doesn't require scheduling. Value tasks should be created using the make_value_task factory functions. More...
 

Enumerations

enum  task_type {
  task_type::root, task_type::accept, task_type::accept_any, task_type::consume,
  task_type::consume_any, task_type::wait, task_type::wait_any
}
 The possible task types. More...
 
enum  schedule_type { schedule_type::breadth, schedule_type::depth }
 Determines in which order tasks are scheduled in the graph. More...
 
enum  event_type { event_type::before_scheduled, event_type::after_started, event_type::before_finished }
 An enum of task events used with the listener pattern. More...
 

Functions

std::string to_string (const transwarp::task_type &type)
 String conversion for the task_type enumeration.
 
std::string to_string (const transwarp::node &node, const std::string &seperator="\n")
 String conversion for the node class.
 
std::string to_string (const transwarp::edge &edge, const std::string &separator="\n")
 String conversion for the edge class.
 
std::string to_string (const std::vector< transwarp::edge > &graph, const std::string &separator="\n")
 Creates a dot-style string from the given graph.
 
template<typename TaskType , typename Functor , typename... Parents>
auto make_task (TaskType, std::string name, Functor &&functor, std::shared_ptr< Parents >...parents) -> decltype(std::make_shared< transwarp::task_impl< TaskType, typename std::decay< Functor >::type, typename Parents::result_type...>>(std::move(name), std::forward< Functor >(functor), std::move(parents)...))
 A factory function to create a new task.
 
template<typename TaskType , typename Functor , typename... Parents>
auto make_task (TaskType, Functor &&functor, std::shared_ptr< Parents >...parents) -> decltype(std::make_shared< transwarp::task_impl< TaskType, typename std::decay< Functor >::type, typename Parents::result_type...>>(std::forward< Functor >(functor), std::move(parents)...))
 A factory function to create a new task. Overload for omitting the task name.
 
template<typename Value >
auto make_value_task (std::string name, Value &&value) -> decltype(std::make_shared< transwarp::value_task< typename std::decay< Value >::type >>(std::move(name), std::forward< Value >(value)))
 A factory function to create a new value task.
 
template<typename Value >
auto make_value_task (Value &&value) -> decltype(std::make_shared< transwarp::value_task< typename std::decay< Value >::type >>(std::forward< Value >(value)))
 A factory function to create a new value task. Overload for omitting the task name.
 

Variables

constexpr transwarp::root_type root {}
 The root task tag.
 
constexpr transwarp::accept_type accept {}
 The accept task tag.
 
constexpr
transwarp::accept_any_type 
accept_any {}
 The accept_any task tag.
 
constexpr transwarp::consume_type consume {}
 The consume task tag.
 
constexpr
transwarp::consume_any_type 
consume_any {}
 The consume_any task tag.
 
constexpr transwarp::wait_type wait {}
 The wait task tag.
 
constexpr transwarp::wait_any_type wait_any {}
 The wait_any task tag.
 

Detailed Description

The transwarp namespace.

Enumeration Type Documentation

enum transwarp::event_type
strong

An enum of task events used with the listener pattern.

Enumerator
before_scheduled 

just before a task is scheduled (handle_event called on thread of caller to schedule())

after_started 

just after a task has started running (handle_event called on thread that task is run on)

before_finished 

just before a task finishes running (handle_event called on thread that task is run on)

Determines in which order tasks are scheduled in the graph.

Enumerator
breadth 

Scheduling according to a breadth-first search (default)

depth 

Scheduling according to a depth-first search.

enum transwarp::task_type
strong

The possible task types.

Enumerator
root 

The task has no parents.

accept 

The task's functor accepts all parent futures.

accept_any 

The task's functor accepts the first parent future that becomes ready.

consume 

The task's functor consumes all parent results.

consume_any 

The task's functor consumes the first parent result that becomes ready.

wait 

The task's functor takes no arguments but waits for all parents to finish.

wait_any 

The task's functor takes no arguments but waits for the first parent to finish.