The transwarp namespace. More...
Namespaces | |
detail | |
Detail namespace for internal functionality only. | |
Classes | |
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 | invalid_parameter |
Exception thrown when an invalid parameter was passed to a function. More... | |
class | control_error |
Exception thrown when a task is used in unintended ways. More... | |
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 | executor |
The executor interface used to perform custom task execution. More... | |
class | listener |
The listener interface to listen to events raised by tasks. More... | |
class | edge |
An edge between two tasks. More... | |
class | itask |
An interface for the task class. More... | |
class | task |
The task class. More... | |
class | task< ResultType & > |
The task class (reference result type) More... | |
class | task< void > |
The task class (void result type) More... | |
class | functor |
A base class for a user-defined functor that needs access to the associated task or a cancel point to stop a task while it's running. More... | |
struct | no_op_functor |
A functor not doing nothing. 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... | |
class | task_pool |
A task pool that allows running multiple instances of the same task in parallel. More... | |
class | timer |
A timer that tracks the average idle, wait, and run time of each task it listens to. More... | |
Typedefs | |
template<typename T > | |
using | decay_t = std::remove_const_t< std::remove_reference_t< T >> |
Removes reference and const from a type. | |
template<typename T > | |
using | result_t = std::result_of_t< decltype(&std::shared_future< T >::get)(std::shared_future< T >)> |
Returns the result type of a std::shared_future<T> | |
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 | event_type { event_type::before_scheduled, event_type::before_started, event_type::before_invoked, event_type::after_finished, event_type::after_canceled, count } |
The task events that can be subscribed to using the listener interface. More... | |
Functions | |
std::string | to_string (const transwarp::task_type &type) |
String conversion for the task_type enumeration. | |
std::string | to_string (const transwarp::itask &task, std::string_view separator="\n") |
String conversion for the itask class. | |
std::string | to_string (const transwarp::edge &edge, std::string_view separator="\n") |
String conversion for the edge class. | |
std::string | to_string (const std::vector< transwarp::edge > &edges, std::string_view separator="\n") |
Creates a dot-style string from the given edges. | |
template<typename TaskType , typename Functor , typename... Parents> | |
auto | make_task (TaskType, Functor &&functor, std::shared_ptr< Parents >...parents) |
A factory function to create a new task. | |
template<typename TaskType , typename Functor , typename ParentType > | |
auto | make_task (TaskType, Functor &&functor, std::vector< ParentType > parents) |
A factory function to create a new task with vector parents. | |
template<typename Value > | |
auto | make_value_task (Value &&value) |
A factory function to create a new value task. | |
template<typename InputIt , typename UnaryOperation > | |
auto | for_each (InputIt first, InputIt last, UnaryOperation unary_op) |
A function similar to std::for_each but returning a transwarp task for deferred, possibly asynchronous execution. This function creates a graph with std::distance(first, last) root tasks. | |
template<typename InputIt , typename UnaryOperation > | |
auto | for_each (transwarp::executor &executor, InputIt first, InputIt last, UnaryOperation unary_op) |
A function similar to std::for_each but returning a transwarp task for deferred, possibly asynchronous execution. This function creates a graph with std::distance(first, last) root tasks. Overload for automatic scheduling by passing an executor. | |
template<typename InputIt , typename OutputIt , typename UnaryOperation > | |
auto | transform (InputIt first1, InputIt last1, OutputIt d_first, UnaryOperation unary_op) |
A function similar to std::transform but returning a transwarp task for deferred, possibly asynchronous execution. This function creates a graph with std::distance(first1, last1) root tasks. | |
template<typename InputIt , typename OutputIt , typename UnaryOperation > | |
auto | transform (transwarp::executor &executor, InputIt first1, InputIt last1, OutputIt d_first, UnaryOperation unary_op) |
A function similar to std::transform but returning a transwarp task for deferred, possibly asynchronous execution. This function creates a graph with std::distance(first1, last1) root tasks. Overload for automatic scheduling by passing an executor. | |
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. | |
constexpr no_op_functor | no_op {} |
An object to use in places where a no-op functor is required. | |
The transwarp namespace.
|
strong |
The task events that can be subscribed to using the listener interface.
|
strong |
The possible task types.