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...
#include <transwarp.h>
Public Types | |
using | task_type = transwarp::root_type |
The task type. | |
using | result_type = ResultType |
The result type of this task. | |
![]() | |
using | result_type = ResultType |
Public Member Functions | |
template<typename T > | |
value_task (bool has_name, std::string name, T &&value) | |
A value task is defined by name and value. Note: Don't use this constructor directly, use transwarp::make_value_task. | |
value_task (const value_task &)=delete | |
value_task & | operator= (const value_task &)=delete |
value_task (value_task &&)=delete | |
value_task & | operator= (value_task &&)=delete |
template<typename TaskType_ , typename Functor_ > | |
std::shared_ptr < transwarp::task_impl < TaskType_, typename std::decay< Functor_ >::type, result_type > > | then (TaskType_, std::string name, Functor_ &&functor) const |
Creates a continuation to this task. | |
template<typename TaskType_ , typename Functor_ > | |
std::shared_ptr < transwarp::task_impl < TaskType_, typename std::decay< Functor_ >::type, result_type > > | then (TaskType_, Functor_ &&functor) const |
Creates a continuation to this task. Overload for omitting the task name. | |
void | set_executor (std::shared_ptr< transwarp::executor >) override |
No-op because a value task never runs. | |
void | set_executor_all (std::shared_ptr< transwarp::executor >) override |
No-op because a value task never runs and doesn't have parents. | |
void | remove_executor () override |
No-op because a value task never runs. | |
void | remove_executor_all () override |
No-op because a value task never runs and doesn't have parents. | |
void | set_priority (std::size_t priority) override |
Sets a task priority (defaults to 0). transwarp will not directly use this. This is only useful if something else is using the priority. | |
void | set_priority_all (std::size_t priority) override |
Sets a priority to all tasks (defaults to 0). transwarp will not directly use this. This is only useful if something else is using the priority. | |
void | reset_priority () override |
Resets the task priority to 0. | |
void | reset_priority_all () override |
Resets the priority of all tasks to 0. | |
void | set_custom_data (std::shared_ptr< void > custom_data) override |
Assigns custom data to this task. transwarp will not directly use this. This is only useful if something else is using this custom data. | |
void | set_custom_data_all (std::shared_ptr< void > custom_data) override |
Assigns custom data to all tasks. transwarp will not directly use this. This is only useful if something else is using this custom data. | |
void | remove_custom_data () override |
Removes custom data from this task. | |
void | remove_custom_data_all () override |
Removes custom data from all tasks. | |
const std::shared_future < result_type > & | get_future () const noexceptoverride |
Returns the future associated to the underlying execution. | |
const std::shared_ptr < transwarp::node > & | get_node () const noexceptoverride |
Returns the associated node. | |
void | add_listener (std::shared_ptr< transwarp::listener >) override |
No-op because a value task doesn't raise events. | |
void | add_listener (transwarp::event_type, std::shared_ptr< transwarp::listener >) override |
No-op because a value task doesn't raise events. | |
void | add_listener_all (std::shared_ptr< transwarp::listener >) override |
No-op because a value task doesn't raise events. | |
void | add_listener_all (transwarp::event_type, std::shared_ptr< transwarp::listener >) override |
No-op because a value task doesn't raise events. | |
void | remove_listener (const std::shared_ptr< transwarp::listener > &) override |
No-op because a value task doesn't raise events. | |
void | remove_listener (transwarp::event_type, const std::shared_ptr< transwarp::listener > &) override |
No-op because a value task doesn't raise events. | |
void | remove_listener_all (const std::shared_ptr< transwarp::listener > &) override |
No-op because a value task doesn't raise events. | |
void | remove_listener_all (transwarp::event_type, const std::shared_ptr< transwarp::listener > &) override |
No-op because a value task doesn't raise events. | |
void | remove_listeners () override |
No-op because a value task doesn't raise events. | |
void | remove_listeners (transwarp::event_type) override |
No-op because a value task doesn't raise events. | |
void | remove_listeners_all () override |
No-op because a value task doesn't raise events. | |
void | remove_listeners_all (transwarp::event_type) override |
No-op because a value task doesn't raise events. | |
void | schedule () override |
No-op because a value task never runs. | |
void | schedule (transwarp::executor &) override |
No-op because a value task never runs. | |
void | schedule (bool) override |
No-op because a value task never runs. | |
void | schedule (transwarp::executor &, bool) override |
No-op because a value task never runs. | |
void | schedule_all () override |
No-op because a value task never runs and doesn't have parents. | |
void | schedule_all (transwarp::executor &) override |
No-op because a value task never runs and doesn't have parents. | |
void | schedule_all (bool) override |
No-op because a value task never runs and doesn't have parents. | |
void | schedule_all (transwarp::executor &, bool) override |
No-op because a value task never runs and doesn't have parents. | |
void | schedule_all (transwarp::schedule_type) override |
No-op because a value task never runs and doesn't have parents. | |
void | schedule_all (transwarp::executor &, transwarp::schedule_type) override |
No-op because a value task never runs and doesn't have parents. | |
void | schedule_all (transwarp::schedule_type, bool) override |
No-op because a value task never runs and doesn't have parents. | |
void | schedule_all (transwarp::executor &, transwarp::schedule_type, bool) override |
No-op because a value task never runs and doesn't have parents. | |
void | set_value (const typename transwarp::decay< result_type >::type &value) override |
Assigns a value to this task. | |
void | set_value (typename transwarp::decay< result_type >::type &&value) override |
Assigns a value to this task. | |
void | set_exception (std::exception_ptr exception) override |
Assigns an exception to this task. | |
bool | was_scheduled () const noexceptoverride |
Returns true because a value task is scheduled once on construction. | |
void | wait () const override |
No-op because a value task never runs. | |
bool | is_ready () const override |
Returns true because a value task is always ready. | |
bool | has_result () const noexceptoverride |
Returns true because a value task always contains a result. | |
transwarp::result< result_type > ::type | get () const override |
Returns the result of this task. | |
void | reset () override |
No-op because a value task never runs. | |
void | reset_all () override |
No-op because a value task never runs and doesn't have parents. | |
void | cancel (bool) noexceptoverride |
No-op because a value task never runs. | |
void | cancel_all (bool) noexceptoverride |
No-op because a value task never runs and doesn't have parents. | |
std::size_t | get_parent_count () const noexceptoverride |
Returns the number of direct parents of this task. | |
std::size_t | get_task_count () const noexceptoverride |
Returns the number of tasks in the graph. | |
std::vector< transwarp::edge > | get_graph () const override |
Returns an empty graph because a value task doesn't have parents. | |
Additional Inherited Members |
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.