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 , typename = typename std::enable_if<std::is_same<result_type, typename std::decay<T>::type>::value>::type> | |
value_task (std::string name, T &&value) | |
A value task is defined by name and value. name is optional, see overload. | |
template<typename T , typename = typename std::enable_if<std::is_same<result_type, typename std::decay<T>::type>::value>::type> | |
value_task (T &&value) | |
This overload is for omitting the task name. | |
value_task (const value_task &)=delete | |
value_task & | operator= (const value_task &)=delete |
value_task (value_task &&)=delete | |
value_task & | operator= (value_task &&)=delete |
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 | remove_listener (const std::shared_ptr< transwarp::listener > &) 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::remove_refc< result_type >::type &value) override |
Assigns a value to this task. | |
void | set_value (typename transwarp::remove_refc< 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_info < 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::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.